chore: clippy
Some checks are pending
/ cargo-fmtcheck (push) Waiting to run
/ cargo-clippy (push) Waiting to run
/ cargo-test (push) Waiting to run
/ appimage (push) Waiting to run

This commit is contained in:
Gabriele Musco 2025-04-06 13:30:30 +02:00
commit 25c90d175f
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE
2 changed files with 5 additions and 5 deletions

View file

@ -49,13 +49,13 @@ impl LinuxDistro {
Ok(_) if buf.starts_with("PRETTY_NAME=\"") => { Ok(_) if buf.starts_with("PRETTY_NAME=\"") => {
return buf return buf
.split('=') .split('=')
.last() .next_back()
.map(|b| b.trim().trim_matches('"').trim().to_string()); .map(|b| b.trim().trim_matches('"').trim().to_string());
} }
Ok(_) if buf.starts_with("NAME=\"") => { Ok(_) if buf.starts_with("NAME=\"") => {
name = buf name = buf
.split('=') .split('=')
.last() .next_back()
.map(|b| b.trim().trim_matches('"').trim().to_string()); .map(|b| b.trim().trim_matches('"').trim().to_string());
} }
_ => {} _ => {}
@ -79,7 +79,7 @@ impl LinuxDistro {
{ {
let name = buf let name = buf
.split('=') .split('=')
.last() .next_back()
.unwrap_or_default() .unwrap_or_default()
.trim() .trim()
.trim_matches('"') .trim_matches('"')

View file

@ -33,7 +33,7 @@ pub fn create_about_dialog() -> adw::AboutDialog {
const UNKNOWN: &str = "UNKNOWN"; const UNKNOWN: &str = "UNKNOWN";
pub fn populate_debug_info(dialog: &adw::AboutDialog, vkinfo: Option<&VulkanInfo>) { pub fn populate_debug_info(dialog: &adw::AboutDialog, vkinfo: Option<&VulkanInfo>) {
if dialog.debug_info().len() > 0 { if !dialog.debug_info().is_empty() {
return; return;
} }
let distro_family = LinuxDistro::get(); let distro_family = LinuxDistro::get();
@ -70,7 +70,7 @@ pub fn populate_debug_info(dialog: &adw::AboutDialog, vkinfo: Option<&VulkanInfo
.and_then(|s| { .and_then(|s| {
s.split("\n") s.split("\n")
.find(|line| line.starts_with("model name")) .find(|line| line.starts_with("model name"))
.map(|line| line.split(':').last().map(|s| s.trim().to_string())) .map(|line| line.split(':').next_back().map(|s| s.trim().to_string()))
}) })
.flatten() .flatten()
.unwrap_or(UNKNOWN.into()) .unwrap_or(UNKNOWN.into())