Skip to content

Commit 29c8313

Browse files
committed
Silent non important and suppress bad suggestions from clippy
1 parent d53834b commit 29c8313

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

benches/macrobenches.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// std::hint::black_box stable since 1.66, but our MSRV = 1.56.
2+
// criterion::black_box is deprecated in since criterion 0.7.
3+
// Running benchmarks assumed on current Rust version, so this should be fine
4+
#![allow(clippy::incompatible_msrv)]
15
use criterion::{self, criterion_group, criterion_main, Criterion, Throughput};
26
use quick_xml::events::Event;
37
use quick_xml::reader::{NsReader, Reader};

benches/microbenches.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// std::hint::black_box stable since 1.66, but our MSRV = 1.56.
2+
// criterion::black_box is deprecated in since criterion 0.7.
3+
// Running benchmarks assumed on current Rust version, so this should be fine
4+
#![allow(clippy::incompatible_msrv)]
15
use criterion::{self, criterion_group, criterion_main, Criterion};
26
use pretty_assertions::assert_eq;
37
use quick_xml::escape::{escape, unescape};

src/encoding.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ pub fn decode_into(
248248
/// |`3C 3F 78 6D`|UTF-8, ISO 646, ASCII, some part of ISO 8859, Shift-JIS, EUC, or any other 7-bit, 8-bit, or mixed-width encoding which ensures that the characters of ASCII have their normal positions, width, and values; the actual encoding declaration must be read to detect which of these applies, but since all of these encodings use the same bit patterns for the relevant ASCII characters, the encoding declaration itself may be read reliably
249249
#[cfg(feature = "encoding")]
250250
pub fn detect_encoding(bytes: &[u8]) -> Option<(&'static Encoding, usize)> {
251+
// Prevent suggesting "<?xm". We want to have the same formatted lines for all arms.
252+
#[allow(clippy::byte_char_slices)]
251253
match bytes {
252254
// with BOM
253255
_ if bytes.starts_with(UTF16_BE_BOM) => Some((UTF_16BE, 2)),

src/se/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ macro_rules! forward {
435435
///
436436
/// <https://www.w3.org/TR/xml11/#NT-NameStartChar>
437437
const fn is_xml11_name_start_char(ch: char) -> bool {
438+
// Not need to use macro when core primitives is enough
439+
#[allow(clippy::match_like_matches_macro)]
438440
match ch {
439441
':'
440442
| 'A'..='Z'

0 commit comments

Comments
 (0)