mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-04 08:44:40 +01:00
Tidy up src/backup/google.rs
Adds an `Eq` derive, makes the `Google` struct into a unit struct rather than an empty struct, as well as changes out a rather useless `match` with an `if let Err(_) = ...` statement.
This commit is contained in:
parent
39f9aeb53f
commit
50309a05d0
1 changed files with 4 additions and 5 deletions
|
@ -7,8 +7,8 @@ use prost::{Enumeration, Message};
|
|||
use std::borrow::Cow;
|
||||
use url::Url;
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq)]
|
||||
pub struct Google {}
|
||||
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Google;
|
||||
|
||||
impl Restorable for Google {
|
||||
const ENCRYPTABLE: bool = false;
|
||||
|
@ -96,9 +96,8 @@ impl Restorable for Google {
|
|||
|
||||
let mut buffer = [0; 128];
|
||||
|
||||
match binascii::b32encode(secret, &mut buffer) {
|
||||
Ok(_) => (),
|
||||
Err(_) => return folded,
|
||||
if let Err(_) = binascii::b32encode(secret, &mut buffer) {
|
||||
return folded;
|
||||
}
|
||||
|
||||
let buffer = buffer.to_vec();
|
||||
|
|
Loading…
Add table
Reference in a new issue