Skip to content

Commit e0ba190

Browse files
estodicakebaker
andauthored
Update src/uu/pmap/src/smaps_format_parser.rs
Incorporate the suggested change Co-authored-by: Daniel Hofstetter <[email protected]>
1 parent 08a20fa commit e0ba190

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/uu/pmap/src/smaps_format_parser.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,8 @@ pub fn parse_smap_entries(contents: &str) -> Result<Vec<SmapEntry>, Error> {
6363
if key == "VmFlags" {
6464
smap_entry.vmflags = val.into();
6565
} else {
66-
let val = if let Some(val) = val.strip_suffix(" kB") {
67-
get_smap_item_value(val)?
68-
} else {
69-
get_smap_item_value(val)?
70-
};
66+
let val = val.strip_suffix(" kB").unwrap_or(val);
67+
let val = get_smap_item_value(val)?;
7168
match key {
7269
"Size" => {
7370
if smap_entry.map_line.size_in_kb != val {

0 commit comments

Comments
 (0)