@@ -39,31 +39,27 @@ impl<'a> InstallMethod<'a> {
39
39
// Install a toolchain
40
40
#[ cfg_attr( feature = "otel" , tracing:: instrument( err, skip_all) ) ]
41
41
pub ( crate ) async fn install ( & self ) -> Result < UpdateStatus > {
42
- let nh = self . cfg ( ) . notify_handler . clone ( ) ;
42
+ let nh = & self . cfg ( ) . notify_handler ;
43
43
match self {
44
44
InstallMethod :: Copy { .. }
45
45
| InstallMethod :: Link { .. }
46
46
| InstallMethod :: Dist ( DistOptions {
47
47
old_date_version : None ,
48
48
..
49
- } ) => ( nh ) ( RootNotification :: InstallingToolchain ( & self . dest_basename ( ) ) ) ,
50
- _ => ( nh ) ( RootNotification :: UpdatingToolchain ( & self . dest_basename ( ) ) ) ,
49
+ } ) => nh ( RootNotification :: InstallingToolchain ( & self . dest_basename ( ) ) ) ,
50
+ _ => nh ( RootNotification :: UpdatingToolchain ( & self . dest_basename ( ) ) ) ,
51
51
}
52
52
53
- ( self . cfg ( ) . notify_handler ) ( RootNotification :: ToolchainDirectory ( & self . dest_path ( ) ) ) ;
54
- let updated = self
55
- . run ( & self . dest_path ( ) , & |n| {
56
- ( self . cfg ( ) . notify_handler ) ( n. into ( ) )
57
- } )
58
- . await ?;
53
+ nh ( RootNotification :: ToolchainDirectory ( & self . dest_path ( ) ) ) ;
54
+ let updated = self . run ( & self . dest_path ( ) , & |n| nh ( n. into ( ) ) ) . await ?;
59
55
60
56
let status = match updated {
61
57
false => {
62
- ( nh ) ( RootNotification :: UpdateHashMatches ) ;
58
+ nh ( RootNotification :: UpdateHashMatches ) ;
63
59
UpdateStatus :: Unchanged
64
60
}
65
61
true => {
66
- ( nh ) ( RootNotification :: InstalledToolchain ( & self . dest_basename ( ) ) ) ;
62
+ nh ( RootNotification :: InstalledToolchain ( & self . dest_basename ( ) ) ) ;
67
63
match self {
68
64
InstallMethod :: Dist ( DistOptions {
69
65
old_date_version : Some ( ( _, v) ) ,
0 commit comments