diff --git a/core/src/egui/mnemonic.rs b/core/src/egui/mnemonic.rs index 618f6c4..6f24f2f 100644 --- a/core/src/egui/mnemonic.rs +++ b/core/src/egui/mnemonic.rs @@ -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.); diff --git a/core/src/modules/changelog.rs b/core/src/modules/changelog.rs index 1dbc198..b978be5 100644 --- a/core/src/modules/changelog.rs +++ b/core/src/modules/changelog.rs @@ -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|{ diff --git a/core/src/modules/overview.rs b/core/src/modules/overview.rs index f1ad6b9..c69266b 100644 --- a/core/src/modules/overview.rs +++ b/core/src/modules/overview.rs @@ -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") diff --git a/core/src/modules/request.rs b/core/src/modules/request.rs index 50524b4..b871304 100644 --- a/core/src/modules/request.rs +++ b/core/src/modules/request.rs @@ -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())) }, }; diff --git a/core/src/utils/secret.rs b/core/src/utils/secret.rs index ced9acb..b90cebe 100644 --- a/core/src/utils/secret.rs +++ b/core/src/utils/secret.rs @@ -8,23 +8,23 @@ pub fn secret_score(password: impl AsRef) -> 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") } }