File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ impl HomeRebuildArgs {
179179 tracing:: warn!( "spec_location path is not valid UTF-8" ) ;
180180 None
181181 } ,
182- |s| std:: fs:: read_to_string ( s) . ok ( ) ,
182+ |s| std:: fs:: read_to_string ( s) . ok ( ) . map ( |s| s . trim ( ) . to_owned ( ) ) ,
183183 ) ;
184184
185185 let target_specialisation = if self . no_specialisation {
Original file line number Diff line number Diff line change @@ -565,7 +565,9 @@ impl OsRebuildArgs {
565565 & self ,
566566 out_path : & Path ,
567567 ) -> Result < PathBuf > {
568- let current_specialisation = std:: fs:: read_to_string ( SPEC_LOCATION ) . ok ( ) ;
568+ let current_specialisation = std:: fs:: read_to_string ( SPEC_LOCATION )
569+ . ok ( )
570+ . map ( |s| s. trim ( ) . to_owned ( ) ) ;
569571
570572 let target_specialisation = if self . no_specialisation {
571573 None
@@ -701,7 +703,9 @@ impl OsRollbackArgs {
701703 profile_dir. join ( format ! ( "system-{}-link" , target_generation. number) ) ;
702704
703705 // Handle specialisations
704- let current_specialisation = fs:: read_to_string ( SPEC_LOCATION ) . ok ( ) ;
706+ let current_specialisation = fs:: read_to_string ( SPEC_LOCATION )
707+ . ok ( )
708+ . map ( |s| s. trim ( ) . to_owned ( ) ) ;
705709
706710 let target_specialisation = if self . no_specialisation {
707711 None
You can’t perform that action at this time.
0 commit comments