Skip to content

Commit

Permalink
idna: clean up clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Aug 18, 2020
1 parent 6efc7f4 commit e003e93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions idna/src/make_uts46_mapping_table.py
Expand Up @@ -149,7 +149,7 @@ def merge_single_char_ranges(ranges):
optimized_ranges = list(merge_single_char_ranges(optimized_ranges))


print("static TABLE: &'static [Range] = &[")
print("static TABLE: &[Range] = &[")

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

print("];\n")

print("static INDEX_TABLE: &'static [u16] = &[")
print("static INDEX_TABLE: &[u16] = &[")

SINGLE_MARKER = 1 << 15

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

print("];\n")

print("static MAPPING_TABLE: &'static [Mapping] = &[")
print("static MAPPING_TABLE: &[Mapping] = &[")

for ranges in optimized_ranges:
for (first, last, mapping, unicode_str) in ranges:
Expand All @@ -187,5 +187,5 @@ def merge_single_char_ranges(ranges):
def escape_str(s):
return [escape_char(c) for c in s]

print("static STRING_TABLE: &'static str = \"%s\";"
print("static STRING_TABLE: &str = \"%s\";"
% '\\\n '.join(itertools.chain(*[escape_str(s) for s in strtab.keys()])))
3 changes: 2 additions & 1 deletion idna/src/uts46.rs
Expand Up @@ -255,7 +255,7 @@ fn passes_bidi(label: &str, is_bidi_domain: bool) -> bool {
}
}

return true;
true
}

/// http://www.unicode.org/reports/tr46/#Validity_Criteria
Expand Down Expand Up @@ -477,6 +477,7 @@ impl Config {
}
}

#[allow(clippy::enum_variant_names)]
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
enum Error {
PunycodeError,
Expand Down
8 changes: 4 additions & 4 deletions idna/src/uts46_mapping_table.rs
Expand Up @@ -8,7 +8,7 @@

// Generated by make_idna_table.py

static TABLE: &'static [Range] = &[
static TABLE: &[Range] = &[
Range { from: '\u{0}', to: '\u{2c}', },
Range { from: '\u{2d}', to: '\u{2e}', },
Range { from: '\u{2f}', to: '\u{2f}', },
Expand Down Expand Up @@ -1661,7 +1661,7 @@ static TABLE: &'static [Range] = &[
Range { from: '\u{e01f0}', to: '\u{10ffff}', },
];

static INDEX_TABLE: &'static [u16] = &[
static INDEX_TABLE: &[u16] = &[
32768,
32769,
32770,
Expand Down Expand Up @@ -3314,7 +3314,7 @@ static INDEX_TABLE: &'static [u16] = &[
40550,
];

static MAPPING_TABLE: &'static [Mapping] = &[
static MAPPING_TABLE: &[Mapping] = &[
DisallowedStd3Valid,
Valid,
DisallowedStd3Valid,
Expand Down Expand Up @@ -11100,7 +11100,7 @@ static MAPPING_TABLE: &'static [Mapping] = &[
Disallowed,
];

static STRING_TABLE: &'static str = "\u{61}\
static STRING_TABLE: &str = "\u{61}\
\u{62}\
\u{63}\
\u{64}\
Expand Down

0 comments on commit e003e93

Please sign in to comment.