Skip to content

Commit

Permalink
Update nitrokey-rs to 16f6c38 (branch backend)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinkrahl committed Feb 24, 2022
1 parent 81554c7 commit 09c07a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ version = "0.2"
version = "0.1"

[dependencies.nitrokey]
version = "0.9.0"
git = "https://git.sr.ht/~ireas/nitrokey-rs"
branch = "backend"

[dependencies.progressing]
version = "3.0.2"
Expand Down
12 changes: 6 additions & 6 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fn find_device(config: &config::Config) -> anyhow::Result<nitrokey::DeviceInfo>

/// Connect to a Nitrokey device that matches the given requirements
fn connect<'mgr>(
manager: &'mgr mut nitrokey::Manager,
manager: &'mgr nitrokey::Manager,
config: &config::Config,
) -> anyhow::Result<nitrokey::DeviceWrapper<'mgr>> {
let device_info = find_device(config)?;
Expand All @@ -131,12 +131,12 @@ fn with_device<F>(ctx: &mut Context<'_>, op: F) -> anyhow::Result<()>
where
F: FnOnce(&mut Context<'_>, nitrokey::DeviceWrapper<'_>) -> anyhow::Result<()>,
{
let mut manager =
let manager =
nitrokey::take().context("Failed to acquire access to Nitrokey device manager")?;

set_log_level(ctx);

let device = connect(&mut manager, &ctx.config)?;
let device = connect(&manager, &ctx.config)?;
op(ctx, device)
}

Expand All @@ -145,7 +145,7 @@ fn with_storage_device<F>(ctx: &mut Context<'_>, op: F) -> anyhow::Result<()>
where
F: FnOnce(&mut Context<'_>, nitrokey::Storage<'_>) -> anyhow::Result<()>,
{
let mut manager =
let manager =
nitrokey::take().context("Failed to acquire access to Nitrokey device manager")?;

set_log_level(ctx);
Expand All @@ -158,7 +158,7 @@ where
ctx.config.model = Some(args::DeviceModel::Storage);
}

let device = connect(&mut manager, &ctx.config)?;
let device = connect(&manager, &ctx.config)?;
if let nitrokey::DeviceWrapper::Storage(storage) = device {
op(ctx, storage)
} else {
Expand Down Expand Up @@ -518,7 +518,7 @@ pub fn list(ctx: &mut Context<'_>, no_connect: bool) -> anyhow::Result<()> {
println!(ctx, "No Nitrokey device connected")?;
} else {
println!(ctx, "USB path\tmodel\tserial number")?;
let mut manager =
let manager =
nitrokey::take().context("Failed to acquire access to Nitrokey device manager")?;

for device_info in device_infos {
Expand Down

0 comments on commit 09c07a5

Please sign in to comment.