File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -995,8 +995,8 @@ impl<T: Default + Clone> expr_builder::ExprBuilder for ExprBuilder<T> {
995
995
}
996
996
}
997
997
998
- fn with_source_loc ( mut self , maybe_source_loc : & Loc ) -> Self {
999
- self . source_loc = Some ( maybe_source_loc . clone ( ) ) ;
998
+ fn with_source_loc ( mut self , source_loc : & Loc ) -> Self {
999
+ self . source_loc = Some ( source_loc . clone ( ) ) ;
1000
1000
self
1001
1001
}
1002
1002
Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ impl RestrictedExpr {
87
87
}
88
88
89
89
/// Return the `RestrictedExpr`, but with the new `source_loc` (or `None`).
90
- pub fn with_source_loc ( self , source_loc : Loc ) -> Self {
91
- Self ( self . 0 . with_maybe_source_loc ( Some ( source_loc) ) )
90
+ pub fn with_maybe_source_loc ( self , source_loc : Option < Loc > ) -> Self {
91
+ Self ( self . 0 . with_maybe_source_loc ( source_loc) )
92
92
}
93
93
94
94
/// Create a `RestrictedExpr` that's just a single `Literal`.
@@ -240,10 +240,7 @@ impl RestrictedExpr {
240
240
241
241
impl From < Value > for RestrictedExpr {
242
242
fn from ( value : Value ) -> RestrictedExpr {
243
- match value. loc {
244
- Some ( loc) => RestrictedExpr :: from ( value. value ) . with_source_loc ( loc) ,
245
- None => RestrictedExpr :: from ( value. value ) ,
246
- }
243
+ RestrictedExpr :: from ( value. value ) . with_maybe_source_loc ( value. loc )
247
244
}
248
245
}
249
246
Original file line number Diff line number Diff line change @@ -958,10 +958,13 @@ impl<T: 'static> WithUnresolvedCommonTypeRefs<T> {
958
958
f : impl FnOnce ( T ) -> U + ' static ,
959
959
) -> WithUnresolvedCommonTypeRefs < U > {
960
960
match self {
961
- Self :: WithUnresolved ( resolve_func, loc) => WithUnresolvedCommonTypeRefs :: new (
962
- move |common_type_defs| resolve_func ( common_type_defs) . map ( f) ,
963
- loc,
964
- ) ,
961
+ Self :: WithUnresolved ( _, ref loc) => {
962
+ let loc = loc. clone ( ) ;
963
+ WithUnresolvedCommonTypeRefs :: new (
964
+ |common_type_defs| self . resolve_common_type_refs ( common_type_defs) . map ( f) ,
965
+ loc,
966
+ )
967
+ }
965
968
Self :: WithoutUnresolved ( v, loc) => {
966
969
WithUnresolvedCommonTypeRefs :: WithoutUnresolved ( f ( v) , loc)
967
970
}
You can’t perform that action at this time.
0 commit comments