diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2018-06-07 16:07:08 +0200 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2018-06-07 16:07:08 +0200 |
commit | 2c11acabd9a8c104fa564cca480088c11c9e8af9 (patch) | |
tree | d2c71624697a9e059e38b7b049cc3cb2737168c1 /src/lib.rs | |
parent | 66f22f7fb47197298702a0fefff17c81667b2739 (diff) | |
download | nitrokey-rs-2c11acabd9a8c104fa564cca480088c11c9e8af9.tar.gz nitrokey-rs-2c11acabd9a8c104fa564cca480088c11c9e8af9.tar.bz2 |
Use {} instead of {:?} where possible
Most notably, for command errors, this will print a human-readable error
message instead of just the name of the enum.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -47,10 +47,10 @@ //! Ok(admin) => { //! match admin.write_hotp_slot(slot_data, 0) { //! Ok(()) => println!("Successfully wrote slot."), -//! Err(err) => println!("Could not write slot: {:?}", err), +//! Err(err) => println!("Could not write slot: {}", err), //! } //! }, -//! Err((_, err)) => println!("Could not authenticate as admin: {:?}", err), +//! Err((_, err)) => println!("Could not authenticate as admin: {}", err), //! } //! # Ok(()) //! # } @@ -65,8 +65,8 @@ //! # fn try_main() -> Result<(), (CommandError)> { //! let device = nitrokey::connect()?; //! match device.get_hotp_code(1) { -//! Ok(code) => println!("Generated HOTP code: {:?}", code), -//! Err(err) => println!("Could not generate HOTP code: {:?}", err), +//! Ok(code) => println!("Generated HOTP code: {}", code), +//! Err(err) => println!("Could not generate HOTP code: {}", err), //! } //! # Ok(()) //! # } |