Skip to content

Commit 9f3bcef

Browse files
committed
Delete unused tuple fields
1 parent 1d0161b commit 9f3bcef

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

Diff for: src/print/fuchsia.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ fn get_build_id<'a>(info: &'a dl_phdr_info) -> Option<&'a [u8]> {
336336
enum Error {
337337
/// NameError means that an error occurred while converting a C style string
338338
/// into a rust string.
339-
NameError(core::str::Utf8Error),
339+
NameError,
340340
/// BuildIDError means that we didn't find a build ID. This could either be
341341
/// because the DSO had no build ID or because the segment containing the
342342
/// build ID was malformed.
@@ -362,8 +362,8 @@ fn for_each_dso(mut visitor: &mut DsoPrinter<'_, '_>) {
362362
unsafe { core::slice::from_raw_parts(info.name as *const u8, name_len) };
363363
let name = match core::str::from_utf8(name_slice) {
364364
Ok(name) => name,
365-
Err(err) => {
366-
return visitor.error(Error::NameError(err)) as i32;
365+
Err(_) => {
366+
return visitor.error(Error::NameError) as i32;
367367
}
368368
};
369369
let build_id = match get_build_id(info) {

Diff for: tests/current-exe-mismatch.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn main() {
1616
Ok(()) => {
1717
println!("test result: ok");
1818
}
19-
Err(EarlyExit::IgnoreTest(_)) => {
19+
Err(EarlyExit::IgnoreTest) => {
2020
println!("test result: ignored");
2121
}
2222
Err(EarlyExit::IoError(e)) => {
@@ -34,7 +34,7 @@ const VAR: &str = "__THE_TEST_YOU_ARE_LUKE";
3434

3535
#[derive(Debug)]
3636
enum EarlyExit {
37-
IgnoreTest(String),
37+
IgnoreTest,
3838
IoError(std::io::Error),
3939
}
4040

@@ -47,7 +47,7 @@ impl From<std::io::Error> for EarlyExit {
4747
fn parent() -> Result<(), EarlyExit> {
4848
// If we cannot re-exec this test, there's no point in trying to do it.
4949
if common::cannot_reexec_the_test() {
50-
return Err(EarlyExit::IgnoreTest("(cannot reexec)".into()));
50+
return Err(EarlyExit::IgnoreTest);
5151
}
5252

5353
let me = std::env::current_exe().unwrap();
@@ -111,7 +111,7 @@ fn find_interpreter(me: &Path) -> Result<PathBuf, EarlyExit> {
111111
.arg("-l")
112112
.arg(me)
113113
.output()
114-
.map_err(|_err| EarlyExit::IgnoreTest("readelf invocation failed".into()))?;
114+
.map_err(|_| EarlyExit::IgnoreTest)?;
115115
if result.status.success() {
116116
let r = BufReader::new(&result.stdout[..]);
117117
for line in r.lines() {
@@ -124,11 +124,6 @@ fn find_interpreter(me: &Path) -> Result<PathBuf, EarlyExit> {
124124
}
125125
}
126126
}
127-
128-
Err(EarlyExit::IgnoreTest(
129-
"could not find interpreter from readelf output".into(),
130-
))
131-
} else {
132-
Err(EarlyExit::IgnoreTest("readelf returned non-success".into()))
133127
}
128+
Err(EarlyExit::IgnoreTest)
134129
}

0 commit comments

Comments
 (0)