Решение на Spell Checker от Георги Бонев
Обратно към всички решения
Към профила на Георги Бонев
Резултати
- 0 точки от тестове
- 0 бонус точки
- 0 точки общо
- 0 успешни тест(а)
- 0 неуспешни тест(а)
Код
Лог от изпълнението
Compiling solution v0.1.0 (/tmp/d20200114-2173579-t0mme6/solution)
warning: unused import: `std::collections::HashMap`
--> src/lib.rs:7:5
|
7 | use std::collections::HashMap;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `std::fmt`
--> src/lib.rs:8:5
|
8 | use std::fmt;
| ^^^^^^^^
warning: unused variable: `is_letter`
--> src/lib.rs:13:13
|
13 | let mut is_letter: bool = false;
| ^^^^^^^^^ help: consider prefixing with an underscore: `_is_letter`
|
= note: `#[warn(unused_variables)]` on by default
warning: value assigned to `j` is never read
--> src/lib.rs:109:17
|
109 | let mut j = 0;
| ^
|
= note: `#[warn(unused_assignments)]` on by default
= help: maybe it is overwritten before being read?
warning: unused variable: `item`
--> src/lib.rs:140:27
|
140 | pub fn add(&mut self, item: &str) {
| ^^^^ help: consider prefixing with an underscore: `_item`
warning: unused variable: `word`
--> src/lib.rs:157:13
|
157 | for word in &self.words {
| ^^^^ help: consider prefixing with an underscore: `_word`
warning: variable does not need to be mutable
--> src/lib.rs:13:9
|
13 | let mut is_letter: bool = false;
| ----^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: field is never used: `counts`
--> src/lib.rs:61:5
|
61 | counts:Vec<u32>,
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: function is never used: `main`
--> src/lib.rs:203:1
|
203 | fn main() {
| ^^^^^^^^^
warning: unused return value of `core::str::<impl str>::trim_end` that must be used
--> src/lib.rs:55:5
|
55 | result.trim_end();
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this returns the trimmed string as a new slice, without modifying the original
warning: unused import: `std::collections::HashMap`
--> src/lib.rs:7:5
|
7 | use std::collections::HashMap;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `std::fmt`
--> src/lib.rs:8:5
|
8 | use std::fmt;
| ^^^^^^^^
warning: unused variable: `is_letter`
--> src/lib.rs:13:13
|
13 | let mut is_letter: bool = false;
| ^^^^^^^^^ help: consider prefixing with an underscore: `_is_letter`
|
= note: `#[warn(unused_variables)]` on by default
warning: value assigned to `j` is never read
--> src/lib.rs:109:17
|
109 | let mut j = 0;
| ^
|
= note: `#[warn(unused_assignments)]` on by default
= help: maybe it is overwritten before being read?
warning: unused variable: `item`
--> src/lib.rs:140:27
|
140 | pub fn add(&mut self, item: &str) {
| ^^^^ help: consider prefixing with an underscore: `_item`
warning: unused variable: `word`
--> src/lib.rs:157:13
|
157 | for word in &self.words {
| ^^^^ help: consider prefixing with an underscore: `_word`
warning: variable does not need to be mutable
--> src/lib.rs:13:9
|
13 | let mut is_letter: bool = false;
| ----^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: field is never used: `counts`
--> src/lib.rs:61:5
|
61 | counts:Vec<u32>,
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: unused return value of `core::str::<impl str>::trim_end` that must be used
--> src/lib.rs:55:5
|
55 | result.trim_end();
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this returns the trimmed string as a new slice, without modifying the original
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:93:25
|
93 | let spell_checker = SpellChecker::new("one one two two", "");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:98:25
|
98 | let spell_checker = SpellChecker::new("three four four four", "");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:103:25
|
103 | let spell_checker = SpellChecker::new("one", "");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:109:17
|
109 | let edits = SpellChecker::new("", "влпу").edits1("три");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:135:17
|
135 | let edits = SpellChecker::new("", "авезийпсц").edits2("три");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:159:25
|
159 | let spell_checker = SpellChecker::new("one two three four", "abcdefghijklmnopqrstuvwxyz");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:174:25
|
174 | let spell_checker = SpellChecker::new("Любов, любов, варен картоф", "вюф");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:185:25
|
185 | let spell_checker = SpellChecker::new("Любов, любов, варен картоф", "вюф");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:196:25
|
196 | let spell_checker = SpellChecker::new("Любов, любов, варен картоф", "");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:200:25
|
200 | let spell_checker = SpellChecker::new("Любов, любов, варен картоф", "abcdefghijklmnopqrstuvwxyz");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:204:25
|
204 | let spell_checker = SpellChecker::new("либофф", "ф");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:212:25
|
212 | let spell_checker = SpellChecker::new("boat boot boot boot", "abcdefghijklmnopqrstuvwxyz");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:215:25
|
215 | let spell_checker = SpellChecker::new("boat boat boat boot", "abcdefghijklmnopqrstuvwxyz");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0433]: failed to resolve: use of undeclared type or module `SpellChecker`
--> tests/solution_test.rs:219:25
|
219 | let spell_checker = SpellChecker::new("own pawns pawns pawns", "abcdefghijklmnopqrstuvwxyz");
| ^^^^^^^^^^^^ use of undeclared type or module `SpellChecker`
error[E0425]: cannot find function `clean_line` in this scope
--> tests/solution_test.rs:60:16
|
60 | assert_eq!(clean_line("foo, bar, baz"), String::from("foo bar baz"));
| ^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `clean_line` in this scope
--> tests/solution_test.rs:61:16
|
61 | assert_eq!(clean_line("ала, бала'ница"), String::from("ала бала'ница"));
| ^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `clean_line` in this scope
--> tests/solution_test.rs:62:16
|
62 | assert_eq!(clean_line("-+/"), String::from("-"));
| ^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `clean_line` in this scope
--> tests/solution_test.rs:67:16
|
67 | assert_eq!(clean_line(" foo "), String::from("foo"));
| ^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `clean_line` in this scope
--> tests/solution_test.rs:68:16
|
68 | assert_eq!(clean_line("\tfoo"), String::from("foo"));
| ^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `clean_line` in this scope
--> tests/solution_test.rs:69:16
|
69 | assert_eq!(clean_line(" "), String::from(""));
| ^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `clean_line` in this scope
--> tests/solution_test.rs:70:16
|
70 | assert_eq!(clean_line(""), String::from(""));
| ^^^^^^^^^^ not found in this scope
error[E0599]: no method named `to_string` found for type `solution::WordCounter` in the current scope
--> tests/solution_test.rs:46:24
|
46 | assert_eq!(counter.to_string(), "WordCounter, total count: 0\n");
| ^^^^^^^^^ method not found in `solution::WordCounter`
|
= note: the method `to_string` exists but the following trait bounds were not satisfied:
`solution::WordCounter : std::string::ToString`
error[E0599]: no method named `to_string` found for type `solution::WordCounter` in the current scope
--> tests/solution_test.rs:49:24
|
49 | assert_eq!(counter.to_string(), "WordCounter, total count: 1\none: 1\n");
| ^^^^^^^^^ method not found in `solution::WordCounter`
|
= note: the method `to_string` exists but the following trait bounds were not satisfied:
`solution::WordCounter : std::string::ToString`
error[E0599]: no method named `to_string` found for type `solution::WordCounter` in the current scope
--> tests/solution_test.rs:52:24
|
52 | assert_eq!(counter.to_string(), "WordCounter, total count: 3\ntwo: 2\none: 1\n");
| ^^^^^^^^^ method not found in `solution::WordCounter`
|
= note: the method `to_string` exists but the following trait bounds were not satisfied:
`solution::WordCounter : std::string::ToString`
error[E0599]: no method named `to_string` found for type `solution::WordCounter` in the current scope
--> tests/solution_test.rs:55:24
|
55 | assert_eq!(counter.to_string(), "WordCounter, total count: 6\nthree: 3\ntwo: 2\none: 1\n");
| ^^^^^^^^^ method not found in `solution::WordCounter`
|
= note: the method `to_string` exists but the following trait bounds were not satisfied:
`solution::WordCounter : std::string::ToString`
error: aborting due to 25 previous errors
Some errors have detailed explanations: E0425, E0433, E0599.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `solution`.
To learn more, run the command again with --verbose.
История (1 версия и 2 коментара)
Георги качи първо решение на 14.01.2020 11:48 (преди над 5 години)