Skip to content

Commit

Permalink
fix: Nightly clippy lints (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim authored Jul 18, 2023
1 parent 89d6f32 commit 0b5a7af
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 91 deletions.
2 changes: 1 addition & 1 deletion examples/minidump_stackwalk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl<'a> minidump_processor::SymbolProvider for LocalSymbolProvider<'a> {
.map(|(id, sym)| {
let stats = SymbolStats {
symbol_url: None,
loaded_symbols: matches!(sym, Ok(_)),
loaded_symbols: sym.is_ok(),
corrupt_symbols: matches!(sym, Err(SymbolError::Corrupt)),
};

Expand Down
2 changes: 1 addition & 1 deletion symbolic-common/src/sourcelinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ mod tests {
("/home/user/src/*", "https://linux.com/*"),
];

let mappings = SourceLinkMappings::new(mappings.into_iter());
let mappings = SourceLinkMappings::new(mappings);

assert_eq!(mappings.mappings.len(), 6);

Expand Down
60 changes: 30 additions & 30 deletions symbolic-debuginfo/src/breakpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2104,14 +2104,14 @@ mod tests {
let string = b"MODULE Linux x86_64 492E2DD23CC306CA9C494EEF1533A3810 crash";
let record = BreakpadModuleRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadModuleRecord {
⋮ os: "Linux",
⋮ arch: "x86_64",
⋮ id: "492E2DD23CC306CA9C494EEF1533A3810",
⋮ name: "crash",
⋮}
"###);
"#);

Ok(())
}
Expand All @@ -2122,14 +2122,14 @@ mod tests {
let string = b"MODULE Linux x86_64 6216C672A8D33EC9CF4A1BAB8B29D00E libdispatch.so";
let record = BreakpadModuleRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadModuleRecord {
⋮ os: "Linux",
⋮ arch: "x86_64",
⋮ id: "6216C672A8D33EC9CF4A1BAB8B29D00E",
⋮ name: "libdispatch.so",
⋮}
"###);
"#);

Ok(())
}
Expand All @@ -2139,12 +2139,12 @@ mod tests {
let string = b"FILE 37 /usr/include/libkern/i386/_OSByteOrder.h";
let record = BreakpadFileRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadFileRecord {
⋮ id: 37,
⋮ name: "/usr/include/libkern/i386/_OSByteOrder.h",
⋮}
"###);
"#);

Ok(())
}
Expand All @@ -2154,12 +2154,12 @@ mod tests {
let string = b"FILE 38 /usr/local/src/filename with spaces.c";
let record = BreakpadFileRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadFileRecord {
⋮ id: 38,
⋮ name: "/usr/local/src/filename with spaces.c",
⋮}
"###);
"#);

Ok(())
}
Expand All @@ -2169,12 +2169,12 @@ mod tests {
let string = b"INLINE_ORIGIN 3529 LZ4F_initStream";
let record = BreakpadInlineOriginRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
BreakpadInlineOriginRecord {
id: 3529,
name: "LZ4F_initStream",
}
"###);
"#);

Ok(())
}
Expand All @@ -2185,12 +2185,12 @@ mod tests {
b"INLINE_ORIGIN 3576 unsigned int mozilla::AddToHash<char, 0>(unsigned int, char)";
let record = BreakpadInlineOriginRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
BreakpadInlineOriginRecord {
id: 3576,
name: "unsigned int mozilla::AddToHash<char, 0>(unsigned int, char)",
}
"###);
"#);

Ok(())
}
Expand All @@ -2201,15 +2201,15 @@ mod tests {
let string = b"FUNC 1730 1a 0 <name omitted>";
let record = BreakpadFuncRecord::parse(string, Lines::default())?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadFuncRecord {
⋮ multiple: false,
⋮ address: 5936,
⋮ size: 26,
⋮ parameter_size: 0,
⋮ name: "<name omitted>",
⋮}
"###);
"#);

Ok(())
}
Expand All @@ -2219,15 +2219,15 @@ mod tests {
let string = b"FUNC m 1730 1a 0 <name omitted>";
let record = BreakpadFuncRecord::parse(string, Lines::default())?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadFuncRecord {
⋮ multiple: true,
⋮ address: 5936,
⋮ size: 26,
⋮ parameter_size: 0,
⋮ name: "<name omitted>",
⋮}
"###);
"#);

Ok(())
}
Expand All @@ -2237,15 +2237,15 @@ mod tests {
let string = b"FUNC 0 f 0";
let record = BreakpadFuncRecord::parse(string, Lines::default())?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadFuncRecord {
⋮ multiple: false,
⋮ address: 0,
⋮ size: 15,
⋮ parameter_size: 0,
⋮ name: "<unknown>",
⋮}
"###);
"#);

Ok(())
}
Expand Down Expand Up @@ -2308,14 +2308,14 @@ mod tests {
let string = b"PUBLIC 5180 0 __clang_call_terminate";
let record = BreakpadPublicRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadPublicRecord {
⋮ multiple: false,
⋮ address: 20864,
⋮ parameter_size: 0,
⋮ name: "__clang_call_terminate",
⋮}
"###);
"#);

Ok(())
}
Expand All @@ -2325,14 +2325,14 @@ mod tests {
let string = b"PUBLIC m 5180 0 __clang_call_terminate";
let record = BreakpadPublicRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadPublicRecord {
⋮ multiple: true,
⋮ address: 20864,
⋮ parameter_size: 0,
⋮ name: "__clang_call_terminate",
⋮}
"###);
"#);

Ok(())
}
Expand All @@ -2342,14 +2342,14 @@ mod tests {
let string = b"PUBLIC 5180 0";
let record = BreakpadPublicRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
⋮BreakpadPublicRecord {
⋮ multiple: false,
⋮ address: 20864,
⋮ parameter_size: 0,
⋮ name: "<unknown>",
⋮}
"###);
"#);

Ok(())
}
Expand Down Expand Up @@ -2416,7 +2416,7 @@ mod tests {
let string = b"STACK CFI INIT 1880 2d .cfa: $rsp 8 + .ra: .cfa -8 + ^";
let record = BreakpadStackRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
Cfi(
BreakpadStackCfiRecord {
start: 6272,
Expand All @@ -2431,7 +2431,7 @@ mod tests {
),
},
)
"###);
"#);

Ok(())
}
Expand All @@ -2442,7 +2442,7 @@ mod tests {
b"STACK WIN 4 371a c 0 0 0 0 0 0 1 $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =";
let record = BreakpadStackRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
Win(
BreakpadStackWinRecord {
ty: FrameData,
Expand All @@ -2460,7 +2460,7 @@ mod tests {
),
},
)
"###);
"#);

Ok(())
}
Expand Down Expand Up @@ -2496,7 +2496,7 @@ mod tests {
";
let record = BreakpadStackRecord::parse(string)?;

insta::assert_debug_snapshot!(record, @r###"
insta::assert_debug_snapshot!(record, @r#"
Win(
BreakpadStackWinRecord {
ty: FrameData,
Expand All @@ -2514,7 +2514,7 @@ mod tests {
),
},
)
"###);
"#);
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion symbolic-debuginfo/src/dwarf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl<'d> DwarfLineProgram<'d> {
} else {
address
},
rows: sequence_rows.drain(..).collect(),
rows: std::mem::take(&mut sequence_rows),
});
}
prev_address = 0;
Expand Down
Loading

0 comments on commit 0b5a7af

Please sign in to comment.