1
1
use std:: borrow:: Cow ;
2
2
3
3
use crate :: {
4
+ ConstnessOverride ,
4
5
GeneratorEnv ,
5
6
TypeRef ,
6
7
} ;
@@ -15,25 +16,25 @@ pub enum DefinitionLocation {
15
16
#[ derive( Debug ) ]
16
17
pub struct ReturnTypeWrapper < ' tu > {
17
18
type_ref : TypeRef < ' tu > ,
18
- const_hint : Option < bool > ,
19
+ const_hint : ConstnessOverride ,
19
20
definition_location : DefinitionLocation ,
20
21
gen_env : & ' tu GeneratorEnv < ' tu > ,
21
22
}
22
23
23
24
impl < ' tu > ReturnTypeWrapper < ' tu > {
24
25
pub fn new ( type_ref : TypeRef < ' tu > , definition_location : DefinitionLocation , gen_env : & ' tu GeneratorEnv < ' tu > ) -> Self {
25
- Self :: new_ext ( type_ref, None , definition_location, gen_env)
26
+ Self :: new_ext ( type_ref, ConstnessOverride :: No , definition_location, gen_env)
26
27
}
27
28
28
- pub fn new_ext ( type_ref : TypeRef < ' tu > , const_hint : Option < bool > , definition_location : DefinitionLocation , gen_env : & ' tu GeneratorEnv < ' tu > ) -> Self {
29
+ pub fn new_ext ( type_ref : TypeRef < ' tu > , const_hint : ConstnessOverride , definition_location : DefinitionLocation , gen_env : & ' tu GeneratorEnv < ' tu > ) -> Self {
29
30
Self { type_ref, const_hint, definition_location, gen_env }
30
31
}
31
32
32
33
pub fn type_ref ( & self ) -> & TypeRef < ' tu > {
33
34
& self . type_ref
34
35
}
35
36
36
- pub fn const_hint ( & self ) -> Option < bool > {
37
+ pub fn const_hint ( & self ) -> ConstnessOverride {
37
38
self . const_hint
38
39
}
39
40
0 commit comments