mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-11-03 07:26:35 +00:00
refactor: remove duplicate .to_string()
This commit is contained in:
parent
407d98f3fa
commit
e2f19140cf
1 changed files with 2 additions and 6 deletions
|
|
@ -21,11 +21,7 @@ pub fn get_os_pretty_name() -> Result<String, io::Error> {
|
||||||
let pretty_name = os_release_content
|
let pretty_name = os_release_content
|
||||||
.lines()
|
.lines()
|
||||||
.find(|line| line.starts_with("PRETTY_NAME="))
|
.find(|line| line.starts_with("PRETTY_NAME="))
|
||||||
.map(|line| {
|
.map(|line| line.trim_start_matches("PRETTY_NAME=").trim_matches('"'));
|
||||||
line.trim_start_matches("PRETTY_NAME=")
|
|
||||||
.trim_matches('"')
|
|
||||||
.to_string()
|
|
||||||
});
|
|
||||||
|
|
||||||
Ok(pretty_name.unwrap_or("Unknown".to_string()))
|
Ok(pretty_name.unwrap_or("Unknown").to_string())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue