Skip to content

Commit 44c7461

Browse files
only one err for io fail
1 parent 4d2bc88 commit 44c7461

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/symbolize/gimli/parse_running_mmaps_unix.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ pub(super) struct MapsEntry {
5656
}
5757

5858
pub(super) fn parse_maps() -> Result<Vec<MapsEntry>, &'static str> {
59+
let failed_io_err = "couldn't read /proc/self/maps";
5960
let mut v = Vec::new();
6061
let mut proc_self_maps =
61-
File::open("/proc/self/maps").map_err(|_| "Couldn't open /proc/self/maps")?;
62+
File::open("/proc/self/maps").map_err(|_| failed_io_err)?;
6263
let mut buf = String::new();
6364
let _bytes_read = proc_self_maps
6465
.read_to_string(&mut buf)
65-
.map_err(|_| "Couldn't read /proc/self/maps")?;
66+
.map_err(|_| failed_io_err)?;
6667
for line in buf.lines() {
6768
v.push(line.parse()?);
6869
}

0 commit comments

Comments
 (0)