Skip to content

Commit 277b997

Browse files
committed
lint and remove unused diagnostic
1 parent d1741f6 commit 277b997

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/errors.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ use rustc_middle::ty::Ty;
44
use rustc_span::{Span, Symbol};
55
use std::borrow::Cow;
66

7-
struct ExitCode {
8-
pub exit_code: Option<i32>,
9-
}
7+
struct ExitCode(Option<i32>);
108

119
impl IntoDiagnosticArg for ExitCode {
1210
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
13-
match self.exit_code {
11+
let ExitCode(exit_code) = self;
12+
match exit_code {
1413
Some(t) => t.into_diagnostic_arg(),
1514
None => DiagnosticArgValue::Str(Cow::Borrowed("None")),
1615
}
@@ -25,8 +24,7 @@ pub(crate) struct RanlibFailure {
2524

2625
impl RanlibFailure {
2726
pub fn new(exit_code: Option<i32>) -> Self {
28-
let exit_code = ExitCode{ exit_code };
29-
RanlibFailure { exit_code }
27+
RanlibFailure { exit_code: ExitCode(exit_code) }
3028
}
3129
}
3230

0 commit comments

Comments
 (0)