mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-04 00:34:40 +01:00
Fix clippy warnings
This commit is contained in:
parent
2de436ee22
commit
fd500ce440
4 changed files with 8 additions and 7 deletions
|
@ -91,7 +91,7 @@ mod imp {
|
||||||
let preferences_action = gio::ActionEntry::builder("preferences")
|
let preferences_action = gio::ActionEntry::builder("preferences")
|
||||||
.activate(|app: &Self::Type, _, _| {
|
.activate(|app: &Self::Type, _, _| {
|
||||||
let window = app.active_window();
|
let window = app.active_window();
|
||||||
let preferences = PreferencesWindow::new();
|
let preferences = PreferencesWindow::default();
|
||||||
preferences.set_has_set_password(app.can_be_locked());
|
preferences.set_has_set_password(app.can_be_locked());
|
||||||
preferences.connect_has_set_password_notify(clone!(
|
preferences.connect_has_set_password_notify(clone!(
|
||||||
#[weak]
|
#[weak]
|
||||||
|
|
|
@ -83,7 +83,7 @@ pub async fn has_set_password() -> anyhow::Result<bool> {
|
||||||
.search_items(&attributes)
|
.search_items(&attributes)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(items) => Ok(items.first().is_some()),
|
Ok(items) => Ok(!items.is_empty()),
|
||||||
_ => Ok(false),
|
_ => Ok(false),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,6 @@ impl OTP {
|
||||||
|
|
||||||
/// Code graciously taken from the rust-otp crate.
|
/// Code graciously taken from the rust-otp crate.
|
||||||
/// <https://github.com/TimDumol/rust-otp/blob/master/src/lib.rs>
|
/// <https://github.com/TimDumol/rust-otp/blob/master/src/lib.rs>
|
||||||
|
|
||||||
/// Decodes a secret (given as an RFC4648 base32-encoded ASCII string)
|
/// Decodes a secret (given as an RFC4648 base32-encoded ASCII string)
|
||||||
/// into a byte string. It fails if secret is not a valid Base32 string.
|
/// into a byte string. It fails if secret is not a valid Base32 string.
|
||||||
fn decode_secret(secret: &str) -> Result<Vec<u8>> {
|
fn decode_secret(secret: &str) -> Result<Vec<u8>> {
|
||||||
|
|
|
@ -83,10 +83,6 @@ glib::wrapper! {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PreferencesWindow {
|
impl PreferencesWindow {
|
||||||
pub fn new() -> Self {
|
|
||||||
glib::Object::new()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn setup_widget(&self) {
|
fn setup_widget(&self) {
|
||||||
let imp = self.imp();
|
let imp = self.imp();
|
||||||
|
|
||||||
|
@ -137,3 +133,9 @@ impl PreferencesWindow {
|
||||||
self.insert_action_group("preferences", Some(&imp.actions));
|
self.insert_action_group("preferences", Some(&imp.actions));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for PreferencesWindow {
|
||||||
|
fn default() -> Self {
|
||||||
|
glib::Object::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue