Commit Graph

27 Commits

Author SHA1 Message Date
David Tolnay
90954572e0
Ignore 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
2023-02-26 21:55:27 -07:00
David Tolnay
6fd6b654dd
Revert "Resolve let_underscore_untyped pedantic clippy lint"
This reverts commit d739d18f92.
2023-02-26 21:05:40 -07:00
David Tolnay
d739d18f92
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
2023-02-26 19:32:59 -08:00
David Tolnay
a6337ab376
Fix renamed let_underscore_drop lint
warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
      --> generate/src/main.rs:14:5
       |
    14 |     clippy::let_underscore_drop,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
       |
       = note: `#[warn(renamed_and_removed_lints)]` on by default
2022-11-22 22:24:47 -08:00
David Tolnay
9c116767e1
Resolve manual_let_else clippy lints
error: this could be rewritten as `let...else`
      --> generate/src/main.rs:50:13
       |
    50 | /             let new = match u8::try_from(chunkmap.len()) {
    51 | |                 Ok(byte) => byte,
    52 | |                 Err(_) => panic!("exceeded 256 unique chunks"),
    53 | |             };
       | |______________^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
       = note: `-D clippy::manual-let-else` implied by `-D clippy::pedantic`
    help: consider writing
       |
    50 ~             let Ok(byte) = u8::try_from(chunkmap.len()) else {
    51 +         $crate::rt::begin_panic($msg)
    52 +     };
       |
2022-11-22 22:24:18 -08:00
David Tolnay
726d043ecd
Minimalist error handling by exiting on error 2022-11-03 23:41:41 -07:00
David Tolnay
34c0dd1fe4
Replace ucd-parse dependency 2022-11-03 23:21:04 -07:00
David Tolnay
834e16aba1
Replace ucd-generate dependency with ucd-parse 2022-11-03 22:39:42 -07:00
David Tolnay
c384237743
Bump version number in UCD zip URL 2022-11-03 22:24:39 -07:00
David Tolnay
556e01ba9b
Return i/o Result from main 2022-11-03 19:13:44 -07:00
David Tolnay
1e397a78e7
Link to cast_possible_truncation false positive
https://github.com/rust-lang/rust-clippy/issues/9613
2022-10-08 12:41:04 -07:00
David Tolnay
fed8ff26f4
Ignore pedantic clippy in ucd-generate generated code 2022-10-08 12:40:40 -07:00
David Tolnay
672c8b5f12
Resolve redundant_closure_for_method_calls pedantic clippy lint 2022-10-08 12:39:49 -07:00
David Tolnay
35ccb3f549
Run clippy on all crates in workspace 2022-10-08 12:24:29 -07:00
David Tolnay
9150ce272e
Pull out static generated file heading into one string literal 2022-10-08 12:20:46 -07:00
David Tolnay
339634349b
Move Output writing to separate module 2022-10-08 12:16:58 -07:00
David Tolnay
3f1a9570b5
Improve table generator failure messages 2022-09-14 21:28:53 -07:00
David Tolnay
d356f5843e
Update to Unicode 15.0.0 2022-09-13 21:19:57 -07:00
David Tolnay
4280713c30
Add authors to Cargo.toml 2022-07-31 19:25:47 -07:00
David Tolnay
ad753364e0
Add @generated comment to the top of tables.rs 2022-06-13 15:44:43 -07:00
David Tolnay
a9b0f17ff8
Import TryFrom to unbreak generate
This was changed from 2021 edition to 2018 edition in f071db5000,
which no longer has TryFrom in prelude.

    error[E0599]: no function or associated item named `try_from` found for type `u8` in the current scope
      --> generate/src/main.rs:56:27
       |
    56 |             let new = u8::try_from(chunkmap.len()).unwrap();
       |                           ^^^^^^^^ function or associated item not found in `u8`
       |
       = help: items from traits can only be used if the trait is in scope
    help: the following trait is implemented but not in scope; perhaps add a `use` for it:
       |
    11 | use std::convert::TryFrom;
       |

    error[E0599]: no function or associated item named `try_from` found for type `u8` in the current scope
       --> generate/src/main.rs:119:17
        |
    119 |             u8::try_from(halfdense.len() / (CHUNK / 2)).unwrap(),
        |                 ^^^^^^^^ function or associated item not found in `u8`
        |
        = help: items from traits can only be used if the trait is in scope
    help: the following trait is implemented but not in scope; perhaps add a `use` for it:
        |
    11  | use std::convert::TryFrom;
        |

    error[E0599]: no function or associated item named `try_from` found for type `u8` in the current scope
       --> generate/src/main.rs:136:21
        |
    136 |                 u8::try_from(halfdense.len() / (CHUNK / 2) - 1).unwrap(),
        |                     ^^^^^^^^ function or associated item not found in `u8`
        |
        = help: items from traits can only be used if the trait is in scope
    help: the following trait is implemented but not in scope; perhaps add a `use` for it:
        |
    11  | use std::convert::TryFrom;
        |
2022-05-19 08:37:30 -07:00
David Tolnay
f071db5000
Make compatible with rustc 1.31 2022-05-16 14:41:51 -07:00
David Tolnay
b6fbaa016b
Generate fst using ucd-generate 2022-05-16 14:25:28 -07:00
David Tolnay
aff0d37f04
Generate a trie-set using ucd-generate 2022-05-16 14:22:22 -07:00
David Tolnay
845d7d08f8
Code to write tables.rs 2022-05-16 14:19:08 -07:00
David Tolnay
115e980050
Add a main.rs to generate the compressed representation 2022-05-16 14:18:35 -07:00
David Tolnay
f231662c62
Add unicode table generated by ucd-generate 2022-05-16 14:17:51 -07:00