File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,12 +135,12 @@ fn compute_merged_options(
135135 target_source : & str ,
136136 new_options : Option < & str > ,
137137) -> Result < CmdlineOwned > {
138- let mut merged = Cmdline :: from ( current_options) ;
138+ let mut result = Cmdline :: from ( current_options) ;
139139
140140 // Remove old options from the target source (if it was previously tracked)
141141 if let Some ( old_source_opts) = source_options. get ( target_source) {
142142 for param in old_source_opts. iter ( ) {
143- merged . remove_exact ( & param) ;
143+ result . remove_exact ( & param) ;
144144 }
145145 }
146146
@@ -149,12 +149,12 @@ fn compute_merged_options(
149149 if !new_opts. is_empty ( ) {
150150 let new_cmdline = Cmdline :: from ( new_opts) ;
151151 for param in new_cmdline. iter ( ) {
152- merged . add ( & param) ;
152+ result . add ( & param) ;
153153 }
154154 }
155155 }
156156
157- Ok ( merged )
157+ Ok ( result )
158158}
159159
160160#[ cfg( test) ]
@@ -263,7 +263,9 @@ mod tests {
263263 #[ test]
264264 fn test_set_options_for_source_in_entry ( ) {
265265 let td = tempfile:: tempdir ( ) . unwrap ( ) ;
266- let entry_path = Utf8Path :: from_path ( td. path ( ) ) . unwrap ( ) . join ( "test.conf" ) ;
266+ let entry_path = Utf8Path :: from_path ( td. path ( ) )
267+ . expect ( "temp path should be valid UTF-8" )
268+ . join ( "test.conf" ) ;
267269
268270 let initial_content = "\
269271 title Test OS
You can’t perform that action at this time.
0 commit comments