diff options
author | Daniel Mueller <deso@posteo.net> | 2020-09-05 06:14:38 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-09-05 06:14:38 -0700 |
commit | 24250081fe899b2f4ddfcf1fffc812e8c5e7b83e (patch) | |
tree | 698fa640cbb96ccba96f7b7b2d8de9fb5a52aa34 /src/tests/reset.rs | |
parent | 0b49693bb87248c1c7d61f5d48cdb3d6253b8ae3 (diff) | |
download | nitrocli-24250081fe899b2f4ddfcf1fffc812e8c5e7b83e.tar.gz nitrocli-24250081fe899b2f4ddfcf1fffc812e8c5e7b83e.tar.bz2 |
Remove Nitrocli::model method
While the Nitrocli::model() method was well intentioned, we do not
actually need it because we create a Nitrocli instance from the model
passed to the individual test. We can just reuse this model instead.
With this patch we do exactly that, allowing us to get rid of
Nitrocli::model() all together.
Diffstat (limited to 'src/tests/reset.rs')
-rw-r--r-- | src/tests/reset.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tests/reset.rs b/src/tests/reset.rs index a7b2097..bf1e75b 100644 --- a/src/tests/reset.rs +++ b/src/tests/reset.rs @@ -20,7 +20,7 @@ fn reset(model: nitrokey::Model) -> anyhow::Result<()> { { let mut manager = nitrokey::force_take()?; // Check that the admin PIN has been changed. - let device = manager.connect_model(ncli.model().unwrap())?; + let device = manager.connect_model(model)?; let _ = device.authenticate_admin(new_admin_pin).unwrap(); } @@ -32,7 +32,7 @@ fn reset(model: nitrokey::Model) -> anyhow::Result<()> { { let mut manager = nitrokey::force_take()?; // Check that the admin PIN has been reset. - let device = manager.connect_model(ncli.model().unwrap())?; + let device = manager.connect_model(model)?; let mut device = device .authenticate_admin(nitrokey::DEFAULT_ADMIN_PIN) .unwrap(); |