aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/commands.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-01-29 12:25:33 +0100
committerDaniel Mueller <deso@posteo.net>2020-02-03 09:40:32 -0800
commit51d0fbb73eb42325fb2a0832810fd9e1d4339743 (patch)
tree766cfda4a1a9e47ac6cef5f558b3dc93c8372eeb /nitrocli/src/commands.rs
parent3dd4b7795f9a9a4285fe6add70a578e3a84bb59f (diff)
downloadnitrocli-51d0fbb73eb42325fb2a0832810fd9e1d4339743.tar.gz
nitrocli-51d0fbb73eb42325fb2a0832810fd9e1d4339743.tar.bz2
Update nitrokey dependency to 0.6.0
nitrokey 0.6.0 introduced the SerialNumber struct (instead of representing serial numbers as strings). We no longer have to manually format the serial number as SerialNumber implements Display. Import subrepo nitrokey/:nitrokey at 2a8ce725407f32db5ad61c37475719737c9b5c9c
Diffstat (limited to 'nitrocli/src/commands.rs')
-rw-r--r--nitrocli/src/commands.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/nitrocli/src/commands.rs b/nitrocli/src/commands.rs
index e361509..08dad04 100644
--- a/nitrocli/src/commands.rs
+++ b/nitrocli/src/commands.rs
@@ -343,7 +343,7 @@ fn print_status(
ctx,
r#"Status:
model: {model}
- serial number: 0x{id}
+ serial number: {id}
firmware version: {fwv}
user retry count: {urc}
admin retry count: {arc}"#,
@@ -393,7 +393,7 @@ pub fn list(ctx: &mut args::ExecCtx<'_>, no_connect: bool) -> Result<()> {
.map(|m| m.to_string())
.unwrap_or_else(|| "unknown".into());
let serial_number = match device_info.serial_number {
- Some(serial_number) => format!("0x{}", serial_number),
+ Some(serial_number) => serial_number.to_string(),
None => {
// Storage devices do not have the serial number present in
// the device information. We have to connect to them to
@@ -402,7 +402,7 @@ pub fn list(ctx: &mut args::ExecCtx<'_>, no_connect: bool) -> Result<()> {
"N/A".to_string()
} else {
let device = manager.connect_path(device_info.path.clone())?;
- format!("0x{}", device.get_serial_number()?)
+ device.get_serial_number()?.to_string()
}
}
};