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:
Julia Johannesen 2022-06-09 10:54:03 -04:00
parent 39f9aeb53f
commit 50309a05d0
Failed to generate hash of commit

View file

@ -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();