mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-03 16:24: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")
|
||||
.activate(|app: &Self::Type, _, _| {
|
||||
let window = app.active_window();
|
||||
let preferences = PreferencesWindow::new();
|
||||
let preferences = PreferencesWindow::default();
|
||||
preferences.set_has_set_password(app.can_be_locked());
|
||||
preferences.connect_has_set_password_notify(clone!(
|
||||
#[weak]
|
||||
|
|
|
@ -83,7 +83,7 @@ pub async fn has_set_password() -> anyhow::Result<bool> {
|
|||
.search_items(&attributes)
|
||||
.await
|
||||
{
|
||||
Ok(items) => Ok(items.first().is_some()),
|
||||
Ok(items) => Ok(!items.is_empty()),
|
||||
_ => Ok(false),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,6 @@ impl OTP {
|
|||
|
||||
/// Code graciously taken from the rust-otp crate.
|
||||
/// <https://github.com/TimDumol/rust-otp/blob/master/src/lib.rs>
|
||||
|
||||
/// 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.
|
||||
fn decode_secret(secret: &str) -> Result<Vec<u8>> {
|
||||
|
|
|
@ -83,10 +83,6 @@ glib::wrapper! {
|
|||
}
|
||||
|
||||
impl PreferencesWindow {
|
||||
pub fn new() -> Self {
|
||||
glib::Object::new()
|
||||
}
|
||||
|
||||
fn setup_widget(&self) {
|
||||
let imp = self.imp();
|
||||
|
||||
|
@ -137,3 +133,9 @@ impl PreferencesWindow {
|
|||
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