fix history implementation #220
Annotations
1 error and 27 warnings
Rustfmt
The process '/home/runner/.cargo/bin/cargo' failed with exit code 1
|
Rustfmt
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/trial/history.rs#L218
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/trial/history.rs:218:37
|
218 | self.max_misalignment + col as usize
| ^^^^^^^^^^^^ help: try: `col`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
|
this `impl` can be derived:
src/config.rs#L33
warning: this `impl` can be derived
--> src/config.rs:33:1
|
33 | / impl Default for Theme {
34 | | fn default() -> Self {
35 | | Self {}
36 | | }
37 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
31 + #[derive(Default)]
32 | pub struct Theme {}
|
|
function `first_grapheme_cluster` is never used:
src/trial/history.rs#L262
warning: function `first_grapheme_cluster` is never used
--> src/trial/history.rs:262:4
|
262 | fn first_grapheme_cluster(string: &str) -> &str {
| ^^^^^^^^^^^^^^^^^^^^^^
|
multiple associated items are never used:
src/trial/history.rs#L60
warning: multiple associated items are never used
--> src/trial/history.rs:60:12
|
58 | impl History {
| ------------ associated items in this implementation
59 | /// Creates a new history, with empty typed and reference strings.
60 | pub fn new(max_misalignment: usize) -> Self {
| ^^^
...
77 | pub fn push_reference(&mut self, reference: &str) {
| ^^^^^^^^^^^^^^
...
125 | fn push_typed(&mut self, typed: &str) {
| ^^^^^^^^^^
...
184 | const MATCH_COST: u32 = 0;
| ^^^^^^^^^^
...
188 | const MISMATCH_COST: u32 = 2;
| ^^^^^^^^^^^^^
189 | // An insertion or deletion requires one keystroke.
190 | const INSERTION_COST: u32 = 1;
| ^^^^^^^^^^^^^^
191 | const DELETION_COST: u32 = 1;
| ^^^^^^^^^^^^^
192 |
193 | fn tracked_entries_per_row(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^
...
197 | fn row_indices(&self, row: usize) -> impl Iterator<Item = EntryIndices> {
| ^^^^^^^^^^^
...
212 | fn col_indices(&self, col: usize) -> impl Iterator<Item = EntryIndices> {
| ^^^^^^^^^^^
...
240 | fn replacement_cost(&self, row: isize, col: isize) -> Option<u32> {
| ^^^^^^^^^^^^^^^^
|
variants `Match`, `Mismatch`, `Insertion`, `Deletion`, and `Invalid` are never constructed:
src/trial/history.rs#L41
warning: variants `Match`, `Mismatch`, `Insertion`, `Deletion`, and `Invalid` are never constructed
--> src/trial/history.rs:41:5
|
39 | enum NWAction {
| -------- variants in this enum
40 | /// The typed and reference grapheme clusters match.
41 | Match,
| ^^^^^
...
44 | Mismatch,
| ^^^^^^^^
...
48 | Insertion,
| ^^^^^^^^^
...
52 | Deletion,
| ^^^^^^^^
...
55 | Invalid,
| ^^^^^^^
|
= note: `NWAction` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
|
struct `Trial` is never constructed:
src/trial/mod.rs#L6
warning: struct `Trial` is never constructed
--> src/trial/mod.rs:6:12
|
6 | pub struct Trial {
| ^^^^^
|
function `deserialize_style` is never used:
src/config.rs#L39
warning: function `deserialize_style` is never used
--> src/config.rs:39:4
|
39 | fn deserialize_style<'de, D>(deserializer: D) -> Result<Style, D::Error>
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unused imports: `collections::btree_map::Entry`, `ops::Range`:
src/trial/history.rs#L1
warning: unused imports: `collections::btree_map::Entry`, `ops::Range`
--> src/trial/history.rs:1:11
|
1 | use std::{collections::btree_map::Entry, convert::TryFrom, iter, ops::Range};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
Lint
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Test
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Test:
src/trial/history.rs#L1
unused imports: `collections::btree_map::Entry`, `ops::Range`
|
Test:
src/trial/mod.rs#L6
struct `Trial` is never constructed
|
Test:
src/trial/history.rs#L41
variants `Match`, `Mismatch`, `Insertion`, `Deletion`, and `Invalid` are never constructed
|
Test
`ttyper` (bin "ttyper" test) generated 3 warnings (run `cargo fix --bin "ttyper" --tests` to apply 1 suggestion)
|