Fix clippy warnings

This commit is contained in:
Bilal Elmoussaoui 2025-02-14 15:59:32 +01:00
parent 2de436ee22
commit fd500ce440
4 changed files with 8 additions and 7 deletions

View file

@ -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]

View file

@ -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),
}
}

View file

@ -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>> {

View file

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