mirror of
https://gitee.com/openharmony/third_party_rust_unicode-ident
synced 2024-11-27 01:31:05 +00:00
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:
parent
d91b5d9b58
commit
d739d18f92
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
@ -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]
|
||||||
|
Loading…
Reference in New Issue
Block a user