@@ -112,7 +112,7 @@ fn find_device(config: &config::Config) -> anyhow::Result<nitrokey::DeviceInfo>
112112
113113/// Connect to a Nitrokey device that matches the given requirements
114114fn connect < ' mgr > (
115- manager : & ' mgr mut nitrokey:: Manager ,
115+ manager : & ' mgr nitrokey:: Manager ,
116116 config : & config:: Config ,
117117) -> anyhow:: Result < nitrokey:: DeviceWrapper < ' mgr > > {
118118 let device_info = find_device ( config) ?;
@@ -131,12 +131,11 @@ fn with_device<F>(ctx: &mut Context<'_>, op: F) -> anyhow::Result<()>
131131where
132132 F : FnOnce ( & mut Context < ' _ > , nitrokey:: DeviceWrapper < ' _ > ) -> anyhow:: Result < ( ) > ,
133133{
134- let mut manager =
135- nitrokey:: take ( ) . context ( "Failed to acquire access to Nitrokey device manager" ) ?;
134+ let manager = nitrokey:: take ( ) . context ( "Failed to acquire access to Nitrokey device manager" ) ?;
136135
137136 set_log_level ( ctx) ;
138137
139- let device = connect ( & mut manager, & ctx. config ) ?;
138+ let device = connect ( & manager, & ctx. config ) ?;
140139 op ( ctx, device)
141140}
142141
@@ -145,8 +144,7 @@ fn with_storage_device<F>(ctx: &mut Context<'_>, op: F) -> anyhow::Result<()>
145144where
146145 F : FnOnce ( & mut Context < ' _ > , nitrokey:: Storage < ' _ > ) -> anyhow:: Result < ( ) > ,
147146{
148- let mut manager =
149- nitrokey:: take ( ) . context ( "Failed to acquire access to Nitrokey device manager" ) ?;
147+ let manager = nitrokey:: take ( ) . context ( "Failed to acquire access to Nitrokey device manager" ) ?;
150148
151149 set_log_level ( ctx) ;
152150
@@ -158,7 +156,7 @@ where
158156 ctx. config . model = Some ( args:: DeviceModel :: Storage ) ;
159157 }
160158
161- let device = connect ( & mut manager, & ctx. config ) ?;
159+ let device = connect ( & manager, & ctx. config ) ?;
162160 if let nitrokey:: DeviceWrapper :: Storage ( storage) = device {
163161 op ( ctx, storage)
164162 } else {
@@ -518,7 +516,7 @@ pub fn list(ctx: &mut Context<'_>, no_connect: bool) -> anyhow::Result<()> {
518516 println ! ( ctx, "No Nitrokey device connected" ) ?;
519517 } else {
520518 println ! ( ctx, "USB path\t model\t serial number" ) ?;
521- let mut manager =
519+ let manager =
522520 nitrokey:: take ( ) . context ( "Failed to acquire access to Nitrokey device manager" ) ?;
523521
524522 for device_info in device_infos {
0 commit comments