Resolve let_underscore_untyped pedantic clippy lint

error: non-binding `let` without a type annotation
      --> generate/src/parse.rs:33:9
       |
    33 |         let _ = writeln!(io::stderr(), "{}: {err}\n{suggestion}", ucd_dir.display());
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: consider adding a type annotation or removing the `let` keyword
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped
       = note: `-D clippy::let-underscore-untyped` implied by `-D clippy::pedantic`

    error: non-binding `let` without a type annotation
      --> generate/src/parse.rs:42:13
       |
    42 |             let _ = writeln!(io::stderr(), "{filename} line {i} is unexpected:\n{line}");
       |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: consider adding a type annotation or removing the `let` keyword
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped

    error: non-binding `let` without a type annotation
       --> generate/src/main.rs:151:9
        |
    151 |         let _ = writeln!(io::stderr(), "{}: {err}", path.display());
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider adding a type annotation or removing the `let` keyword
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped

    error: non-binding `let` without a type annotation
      --> tests/static_size.rs:28:5
       |
    28 |     let _ = tables::BY_NAME;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: consider adding a type annotation or removing the `let` keyword
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped
       = note: `-D clippy::let-underscore-untyped` implied by `-D clippy::pedantic`

    error: non-binding `let` without a type annotation
      --> tests/static_size.rs:75:5
       |
    75 |     let _ = trie::BY_NAME;
       |     ^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: consider adding a type annotation or removing the `let` keyword
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped
This commit is contained in:
David Tolnay 2023-02-26 19:31:36 -08:00
parent d91b5d9b58
commit d739d18f92
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 5 additions and 5 deletions

View File

@ -148,7 +148,7 @@ fn main() {
let out = write::output(&properties, &index_start, &index_continue, &halfdense); let out = write::output(&properties, &index_start, &index_continue, &halfdense);
let path = unicode_ident_dir.join(TABLES); let path = unicode_ident_dir.join(TABLES);
if let Err(err) = fs::write(&path, out) { if let Err(err) = fs::write(&path, out) {
let _ = writeln!(io::stderr(), "{}: {err}", path.display()); _ = writeln!(io::stderr(), "{}: {err}", path.display());
process::exit(1); process::exit(1);
} }
} }

View File

@ -30,7 +30,7 @@ pub fn parse_xid_properties(ucd_dir: &Path) -> Properties {
let contents = fs::read_to_string(path).unwrap_or_else(|err| { let contents = fs::read_to_string(path).unwrap_or_else(|err| {
let suggestion = let suggestion =
"Download from https://www.unicode.org/Public/zipped/l5.0.0/UCD.zip and unzip."; "Download from https://www.unicode.org/Public/zipped/l5.0.0/UCD.zip and unzip.";
let _ = writeln!(io::stderr(), "{}: {err}\n{suggestion}", ucd_dir.display()); _ = writeln!(io::stderr(), "{}: {err}\n{suggestion}", ucd_dir.display());
process::exit(1); process::exit(1);
}); });
@ -39,7 +39,7 @@ pub fn parse_xid_properties(ucd_dir: &Path) -> Properties {
continue; continue;
} }
let (lo, hi, name) = parse_line(line).unwrap_or_else(|| { let (lo, hi, name) = parse_line(line).unwrap_or_else(|| {
let _ = writeln!(io::stderr(), "{filename} line {i} is unexpected:\n{line}"); _ = writeln!(io::stderr(), "{filename} line {i} is unexpected:\n{line}");
process::exit(1); process::exit(1);
}); });
let set = match name { let set = match name {

View File

@ -25,7 +25,7 @@ fn test_xid_size() {
let size = size_of_val(tables::XID_START) + size_of_val(tables::XID_CONTINUE); let size = size_of_val(tables::XID_START) + size_of_val(tables::XID_CONTINUE);
assert_eq!(11528, size); assert_eq!(11528, size);
let _ = tables::BY_NAME; _ = tables::BY_NAME;
} }
#[cfg(target_pointer_width = "64")] #[cfg(target_pointer_width = "64")]
@ -72,7 +72,7 @@ fn test_trieset_size() {
assert_eq!(10208, start_size + continue_size); assert_eq!(10208, start_size + continue_size);
let _ = trie::BY_NAME; _ = trie::BY_NAME;
} }
#[test] #[test]