@@ -125,7 +125,7 @@ impl SysrootDownload {
125125 Some ( sysroot_bin ( "rustdoc" ) ?) ,
126126 match sysroot_bin ( "cargo-clippy" ) {
127127 Err ( _) => None ,
128- Ok ( path) => Some ( path)
128+ Ok ( path) => Some ( path) ,
129129 } ,
130130 sysroot_bin ( "cargo" ) ?,
131131 & self . directory . join ( & self . rust_sha ) . join ( "lib" ) ,
@@ -435,26 +435,27 @@ pub fn get_local_toolchain(
435435 None
436436 } ;
437437
438- let clippy =
439- if let Some ( clippy ) = & toolchain_config . clippy {
440- Some ( clippy. canonicalize ( ) . with_context ( || {
438+ let clippy = if let Some ( clippy) = & toolchain_config . clippy {
439+ Some (
440+ clippy. canonicalize ( ) . with_context ( || {
441441 format ! ( "failed to canonicalize clippy executable {:?}" , clippy)
442- } ) ?)
443- } else if profiles. contains ( & Profile :: Clippy ) {
444- // We need a `clippy`. Look for one next to `rustc`.
445- if let Ok ( clippy) = rustc. with_file_name ( "cargo-clippy" ) . canonicalize ( ) {
446- debug ! ( "found clippy: {:?}" , & clippy) ;
447- Some ( clippy)
448- } else {
449- anyhow:: bail!(
442+ } ) ?,
443+ )
444+ } else if profiles. contains ( & Profile :: Clippy ) {
445+ // We need a `clippy`. Look for one next to `rustc`.
446+ if let Ok ( clippy) = rustc. with_file_name ( "cargo-clippy" ) . canonicalize ( ) {
447+ debug ! ( "found clippy: {:?}" , & clippy) ;
448+ Some ( clippy)
449+ } else {
450+ anyhow:: bail!(
450451 "'Clippy' build specified but '--clippy' not specified and no 'cargo-clippy' found \
451452 next to 'rustc'"
452453 ) ;
453- }
454- } else {
455- // No `clippy` provided, but none needed.
456- None
457- } ;
454+ }
455+ } else {
456+ // No `clippy` provided, but none needed.
457+ None
458+ } ;
458459 let cargo = if let Some ( cargo) = & toolchain_config. cargo {
459460 cargo
460461 . canonicalize ( )
@@ -483,7 +484,9 @@ pub fn get_local_toolchain(
483484 let lib_dir = get_lib_dir_from_rustc ( & rustc) . context ( "Cannot find libdir for rustc" ) ?;
484485
485486 Ok ( Toolchain {
486- components : ToolchainComponents :: from_binaries_and_libdir ( rustc, rustdoc, clippy, cargo, & lib_dir) ?,
487+ components : ToolchainComponents :: from_binaries_and_libdir (
488+ rustc, rustdoc, clippy, cargo, & lib_dir,
489+ ) ?,
487490 id,
488491 triple : target_triple,
489492 } )
@@ -530,8 +533,13 @@ pub fn create_toolchain_from_published_version(
530533
531534 let lib_dir = get_lib_dir_from_rustc ( & rustc) ?;
532535
533- let components =
534- ToolchainComponents :: from_binaries_and_libdir ( rustc, Some ( rustdoc) , Some ( clippy) , cargo, & lib_dir) ?;
536+ let components = ToolchainComponents :: from_binaries_and_libdir (
537+ rustc,
538+ Some ( rustdoc) ,
539+ Some ( clippy) ,
540+ cargo,
541+ & lib_dir,
542+ ) ?;
535543
536544 Ok ( Toolchain {
537545 components,
0 commit comments