Skip to content

Commit 3fbb060

Browse files
committed
replace lit_snip type with &str
1 parent 2dfb246 commit 3fbb060

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clippy_lints/src/misc_early/mixed_case_hex_literals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_lint::EarlyContext;
44

55
use super::MIXED_CASE_HEX_LITERALS;
66

7-
pub(super) fn check(cx: &EarlyContext<'_>, lit: &Lit, suffix: &str, lit_snip: String) {
7+
pub(super) fn check(cx: &EarlyContext<'_>, lit: &Lit, suffix: &str, lit_snip: &str) {
88
let maybe_last_sep_idx = if let Some(val) = lit_snip.len().checked_sub(suffix.len() + 1) {
99
val
1010
} else {

clippy_lints/src/misc_early/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ impl MiscEarlyLints {
334334
};
335335
unseparated_literal_suffix::check(cx, lit, &lit_snip, suffix, "integer");
336336
if lit_snip.starts_with("0x") {
337-
mixed_case_hex_literals::check(cx, lit, suffix, lit_snip)
337+
mixed_case_hex_literals::check(cx, lit, suffix, &lit_snip)
338338
} else if lit_snip.starts_with("0b") || lit_snip.starts_with("0o") {
339339
/* nothing to do */
340340
} else if value != 0 && lit_snip.starts_with('0') {
341-
zero_prefixed_literal::check(cx, lit, lit_snip)
341+
zero_prefixed_literal::check(cx, lit, &lit_snip)
342342
}
343343
} else if let LitKind::Float(_, LitFloatType::Suffixed(float_ty)) = lit.kind {
344344
let suffix = float_ty.name_str();

clippy_lints/src/misc_early/unseparated_literal_suffix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_lint::EarlyContext;
55

66
use super::UNSEPARATED_LITERAL_SUFFIX;
77

8-
pub(super) fn check(cx: &EarlyContext<'_>, lit: &Lit, lit_snip: &String, suffix: &str, sugg_type: &str) {
8+
pub(super) fn check(cx: &EarlyContext<'_>, lit: &Lit, lit_snip: &str, suffix: &str, sugg_type: &str) {
99
let maybe_last_sep_idx = if let Some(val) = lit_snip.len().checked_sub(suffix.len() + 1) {
1010
val
1111
} else {

clippy_lints/src/misc_early/zero_prefixed_literal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_lint::EarlyContext;
55

66
use super::ZERO_PREFIXED_LITERAL;
77

8-
pub(super) fn check(cx: &EarlyContext<'_>, lit: &Lit, lit_snip: String) {
8+
pub(super) fn check(cx: &EarlyContext<'_>, lit: &Lit, lit_snip: &str) {
99
span_lint_and_then(
1010
cx,
1111
ZERO_PREFIXED_LITERAL,

0 commit comments

Comments
 (0)