Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder83singh committed Dec 9, 2024
1 parent 234ef44 commit 01e0a96
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/src/egui/mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl<'render> MnemonicPresenter<'render> {
.show(ui, |ui| {
let frame_width = ui.available_width();
let num_cols = (frame_width / width_per_col).max(1.0) as usize;
let num_rows = (words.len() + (num_cols - 1)) / num_cols;
let num_rows = words.len().div_ceil(num_cols);

ui.set_max_height(num_rows as f32 * 32.);

Expand Down
2 changes: 1 addition & 1 deletion core/src/modules/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl ModuleT for Changelog {
.auto_shrink([false; 2])
.max_height(max_height)
.show(ui, |ui| {
easy_mark(ui, self.changelog.as_str());
easy_mark(ui, self.changelog);
});

ui.vertical_centered(|ui|{
Expand Down
2 changes: 1 addition & 1 deletion core/src/modules/overview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ impl Overview {
});

if let Some(release) = core.release.as_ref() {
let is_greater = is_version_greater(crate::app::VERSION.as_str(), release.version.as_str()).ok().unwrap_or(false);
let is_greater = is_version_greater(crate::app::VERSION, release.version.as_str()).ok().unwrap_or(false);
if is_wasm() || !is_greater {
CollapsingHeader::new(i18n("Redistributables"))
.id_source("redistributables")
Expand Down
2 changes: 1 addition & 1 deletion core/src/modules/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Request {
Entry::Vacant(entry) => {
let uri = format!("bytes://{hash}.svg");
// let bits = qrcode::types::Mode::Alphanumeric.data_bits_count(request_uri.len());
let qr = render_qrcode_with_version(request_uri.as_str(), 192, 192, qrcode::Version::Normal(10));
let qr = render_qrcode_with_version(request_uri, 192, 192, qrcode::Version::Normal(10));
entry.insert((uri, qr.as_bytes().to_vec().into()))
},
};
Expand Down
18 changes: 9 additions & 9 deletions core/src/utils/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ pub fn secret_score(password: impl AsRef<str>) -> f64 {

pub fn secret_score_to_text(score: f64) -> String {
if (0.0..=20.0).contains(&score) {
return String::from(i18n("Very dangerous (may be cracked within few seconds)"));
String::from(i18n("Very dangerous (may be cracked within few seconds)"))
} else if score > 20.0 && score <= 40.0 {
return String::from(i18n("Dangerous"));
String::from(i18n("Dangerous"))
} else if score > 40.0 && score <= 60.0 {
return String::from(i18n("Very weak"));
String::from(i18n("Very weak"))
} else if score > 60.0 && score <= 80.0 {
return String::from(i18n("Weak"));
String::from(i18n("Weak"))
} else if score > 80.0 && score <= 90.0 {
return String::from(i18n("Good"));
String::from(i18n("Good"))
} else if score > 90.0 && score <= 95.0 {
return String::from(i18n("Strong"));
String::from(i18n("Strong"))
} else if score > 95.0 && score <= 99.0 {
return String::from(i18n("Very strong"));
String::from(i18n("Very strong"))
} else if score > 99.0 && score <= 100.0 {
return String::from(i18n("Invulnerable"));
String::from(i18n("Invulnerable"))
} else {
return String::from("Value is outside the defined range");
String::from("Value is outside the defined range")
}
}

Expand Down

0 comments on commit 01e0a96

Please sign in to comment.