Skip to content

Commit e003e93

Browse files
committed
idna: clean up clippy warnings
1 parent 6efc7f4 commit e003e93

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

idna/src/make_uts46_mapping_table.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def merge_single_char_ranges(ranges):
149149
optimized_ranges = list(merge_single_char_ranges(optimized_ranges))
150150

151151

152-
print("static TABLE: &'static [Range] = &[")
152+
print("static TABLE: &[Range] = &[")
153153

154154
for ranges in optimized_ranges:
155155
first = ranges[0][0]
@@ -159,7 +159,7 @@ def merge_single_char_ranges(ranges):
159159

160160
print("];\n")
161161

162-
print("static INDEX_TABLE: &'static [u16] = &[")
162+
print("static INDEX_TABLE: &[u16] = &[")
163163

164164
SINGLE_MARKER = 1 << 15
165165

@@ -174,7 +174,7 @@ def merge_single_char_ranges(ranges):
174174

175175
print("];\n")
176176

177-
print("static MAPPING_TABLE: &'static [Mapping] = &[")
177+
print("static MAPPING_TABLE: &[Mapping] = &[")
178178

179179
for ranges in optimized_ranges:
180180
for (first, last, mapping, unicode_str) in ranges:
@@ -187,5 +187,5 @@ def merge_single_char_ranges(ranges):
187187
def escape_str(s):
188188
return [escape_char(c) for c in s]
189189

190-
print("static STRING_TABLE: &'static str = \"%s\";"
190+
print("static STRING_TABLE: &str = \"%s\";"
191191
% '\\\n '.join(itertools.chain(*[escape_str(s) for s in strtab.keys()])))

idna/src/uts46.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ fn passes_bidi(label: &str, is_bidi_domain: bool) -> bool {
255255
}
256256
}
257257

258-
return true;
258+
true
259259
}
260260

261261
/// http://www.unicode.org/reports/tr46/#Validity_Criteria
@@ -477,6 +477,7 @@ impl Config {
477477
}
478478
}
479479

480+
#[allow(clippy::enum_variant_names)]
480481
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
481482
enum Error {
482483
PunycodeError,

idna/src/uts46_mapping_table.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// Generated by make_idna_table.py
1010

11-
static TABLE: &'static [Range] = &[
11+
static TABLE: &[Range] = &[
1212
Range { from: '\u{0}', to: '\u{2c}', },
1313
Range { from: '\u{2d}', to: '\u{2e}', },
1414
Range { from: '\u{2f}', to: '\u{2f}', },
@@ -1661,7 +1661,7 @@ static TABLE: &'static [Range] = &[
16611661
Range { from: '\u{e01f0}', to: '\u{10ffff}', },
16621662
];
16631663

1664-
static INDEX_TABLE: &'static [u16] = &[
1664+
static INDEX_TABLE: &[u16] = &[
16651665
32768,
16661666
32769,
16671667
32770,
@@ -3314,7 +3314,7 @@ static INDEX_TABLE: &'static [u16] = &[
33143314
40550,
33153315
];
33163316

3317-
static MAPPING_TABLE: &'static [Mapping] = &[
3317+
static MAPPING_TABLE: &[Mapping] = &[
33183318
DisallowedStd3Valid,
33193319
Valid,
33203320
DisallowedStd3Valid,
@@ -11100,7 +11100,7 @@ static MAPPING_TABLE: &'static [Mapping] = &[
1110011100
Disallowed,
1110111101
];
1110211102

11103-
static STRING_TABLE: &'static str = "\u{61}\
11103+
static STRING_TABLE: &str = "\u{61}\
1110411104
\u{62}\
1110511105
\u{63}\
1110611106
\u{64}\

0 commit comments

Comments
 (0)