Името на стаята е оградено от кутийка, която има + символи в ъглите и N и S отгоре и отдолу, центрирани в страните на кутията. Ако името на стаята има четен брой символи като "Дневна", добавете един интервал накрая, за да се получи нечетен (за да може N и S да бъдат винаги точно по средата).
Същото се отнася за центрирането на северната и южната стая -- ако "центъра" е между два символа, приемете, че има извънреден интервал отдясно. При центрирането на "Баня", чертичката е над "н"-то а не над "а"-то.
Квадратните скоби ([]) са подравнени със стените на кутийката на стаята. Може да приемете, че нито северната, нито южната стая няма да бъдат по-дълги от името name -- няма да тестваме с такива примери. (Ако искате да си имплементирате този случай, вариант е да отрежете твърде-дълги имена, също както е вариант да изберете максималната дължина между трите за обща.)
Също приемете, че няма да тестваме с празни низове за стаи.
Очакваме да няма trailing whitespace след текста. Тоест, ако намерите начин някъде из стандартната библиотека за центриране, супер, но имайте предвид че "центриране" означава padding с интервали и отдясно, което ще fail-не теста по-долу.
Първия написан символ очакваме да е точно един нов ред (символ \n). За да може ако печатаме с println!, да се подсигурим че ще започне на нов ред. Накрая на низа обаче не се output-ва нов ред -- println! би напечатал. Теста по-долу би трябвало да ви минава, basically.
#[test]
fn test_short() {
let room = Room {
name: String::from("X"),
north: String::from("N"),
south: String::from("S"),
east: String::from("E"),
west: String::from("W"),
};
let expected = "
[ N ]
|
+-N-+
W - | X | - E
+-S-+
|
[ S ]";
assert_eq!(format!("{}", room), expected);
}
Както винаги, предизвикателството е "всичко или нищо", така че тествайте внимателно. Задачата не би трябвало да съдържа нещо сложно откъм Rust features, но за сметка на това има потенциала да е досадна работата по центриране и off-by-one errors. Но затова е за бонус точки, все пак -- имате позволението ни да се откажете от човъркането в един момент и да се концентрирате върху проектите си :).
За extra hard mode, опитайте се да минимизирате string allocations и кода да е ясен и прост. Няма да получите бонус точки, но може да ви донесе морално удовлетворение (ако успеете).
Compiling solution v0.1.0 (/tmp/d20220120-3533338-1xbx8ro/solution)
Finished test [unoptimized + debuginfo] target(s) in 1.97s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-173z0l0/solution)
Finished test [unoptimized + debuginfo] target(s) in 1.63s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-ibd1xr/solution)
Finished test [unoptimized + debuginfo] target(s) in 1.58s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-1b00rpb/solution)
warning: variable does not need to be mutable
--> src/lib.rs:12:13
|
12 | let mut fixed_name: String = fix_room_name(self.name.clone());
| ----^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> src/lib.rs:13:13
|
13 | let mut fixed_north: String = fix_room_name(self.north.clone());
| ----^^^^^^^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/lib.rs:14:13
|
14 | let mut fixed_south: String = fix_room_name(self.south.clone());
| ----^^^^^^^^^^^
| |
| help: remove this `mut`
warning: variable `nRow` should have a snake case name
--> src/lib.rs:17:13
|
17 | let nRow = form_row(
| ^^^^ help: convert the identifier to snake case: `n_row`
|
= note: `#[warn(non_snake_case)]` on by default
warning: variable `sRow` should have a snake case name
--> src/lib.rs:22:13
|
22 | let sRow = form_row(
| ^^^^ help: convert the identifier to snake case: `s_row`
warning: variable `fB` should have a snake case name
--> src/lib.rs:28:13
|
28 | let fB = form_begin_f_l_row(
| ^^ help: convert the identifier to snake case: `f_b`
warning: variable `fA` should have a snake case name
--> src/lib.rs:32:13
|
32 | let fA = form_after_f_l_row(
| ^^ help: convert the identifier to snake case: `f_a`
warning: variable `lB` should have a snake case name
--> src/lib.rs:36:13
|
36 | let lB = form_begin_f_l_row(
| ^^ help: convert the identifier to snake case: `l_b`
warning: variable `lA` should have a snake case name
--> src/lib.rs:40:13
|
40 | let lA = form_after_f_l_row(
| ^^ help: convert the identifier to snake case: `l_a`
warning: variable `emptyRow` should have a snake case name
--> src/lib.rs:44:13
|
44 | let emptyRow =
| ^^^^^^^^ help: convert the identifier to snake case: `empty_row`
warning: `solution` (lib) generated 10 warnings
Finished test [unoptimized + debuginfo] target(s) in 1.57s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-m4ewo1/solution)
Finished test [unoptimized + debuginfo] target(s) in 1.89s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-1qeljz6/solution)
Finished test [unoptimized + debuginfo] target(s) in 1.59s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-19eqb10/solution)
Finished test [unoptimized + debuginfo] target(s) in 1.53s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-186vkxq/solution)
warning: unused `Result` that must be used
--> src/lib.rs:46:9
|
46 | write!(f, "\n");
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:78:9
|
78 | write!(f, "{}[{}{}{}]\n", blanks_to_boxes, north_blanks_in_box, formatted_north_room_name, north_blanks_in_box);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:81:9
|
81 | write!(f, "{}|\n", blanks_to_center);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:84:9
|
84 | write!(f, "{}+{}N{}+\n", blanks_to_boxes, minuses, minuses);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:92:9
|
92 | write!(f, "{} - | {} | - {}\n", self.west, formatted_inner_room_name, self.east);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:95:9
|
95 | write!(f, "{}+{}S{}+\n", blanks_to_boxes, minuses, minuses);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:98:9
|
98 | write!(f, "{}|\n", blanks_to_center);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: `solution` (lib) generated 7 warnings
Finished test [unoptimized + debuginfo] target(s) in 1.69s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-1salln5/solution)
Finished test [unoptimized + debuginfo] target(s) in 1.57s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-1u9r5md/solution)
warning: unused `Result` that must be used
--> src/lib.rs:23:9
|
23 | ... write!(f, "\n{: >1$}\n", format!("[{: ^1$}]", format(&self.north), format(&self.name).chars().count()+2), self.west.chars().count()+3+format(&self.name).chars().count()+...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:26:9
|
26 | write!(f, "{: >1$}\n", "|", self.west.chars().count()+3+((format(&self.name).chars().count()+4)/2)+1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:29:9
|
29 | ... write!(f, "{: >1$}\n", format!("+{:-^1$}+", "N", format(&self.name).chars().count()+2), self.west.chars().count()+3+format(&self.name).chars().count()+...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:32:9
|
32 | write!(f, "{} {} {}\n", self.west ,format!("- |{: ^1$}| -", format(&self.name), format(&self.name).chars().count()+2), self.east);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:35:9
|
35 | ... write!(f, "{: >1$}\n", format!("+{:-^1$}+", "S", format(&self.name).chars().count()+2), self.west.chars().count()+3+format(&self.name).chars().count()+...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:38:9
|
38 | write!(f, "{: >1$}\n", "|", self.west.chars().count()+3+((format(&self.name).chars().count()+4)/2)+1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:41:9
|
41 | ... write!(f, "{: >1$}", format!("[{: ^1$}]", format(&self.south), format(&self.name).chars().count()+2), self.west.chars().count()+3+format(&self.name).chars().count()+...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: `solution` (lib) generated 7 warnings
Finished test [unoptimized + debuginfo] target(s) in 1.65s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-cz5xl6/solution)
Finished test [unoptimized + debuginfo] target(s) in 1.50s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... ok
test solution_test::test_short ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Compiling solution v0.1.0 (/tmp/d20220120-3533338-11ljlio/solution)
warning: unused variable: `i`
--> src/lib.rs:28:13
|
28 | for i in 0..self.west.chars().count() {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `i`
--> src/lib.rs:39:13
|
39 | for i in 1..lbuff {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: unused variable: `i`
--> src/lib.rs:49:13
|
49 | for i in 1..rbuff {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: unused variable: `i`
--> src/lib.rs:67:13
|
67 | for i in 0..rbuff {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: unused variable: `i`
--> src/lib.rs:73:13
|
73 | for i in 0..lbuff {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: unused variable: `i`
--> src/lib.rs:94:13
|
94 | for i in 1..self.west.chars().count() + 4 {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: unused variable: `i`
--> src/lib.rs:102:13
|
102 | for i in 1..buff {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: unused variable: `i`
--> src/lib.rs:112:13
|
112 | for i in 1..buff {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
warning: unused `Result` that must be used
--> src/lib.rs:163:9
|
163 | write!(f, "{}", full_str);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: `solution` (lib) generated 9 warnings
Finished test [unoptimized + debuginfo] target(s) in 2.29s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... FAILED
test solution_test::test_short ... ok
failures:
---- solution_test::test_cyrillic stdout ----
num 0, num 1, num 2, num 3, num 4, num 5, num 6, num 7, num 8, num 9, num 10, num 11, num 12, num 13, num 0, num 1, num 2, num 3, num 4, num 5, num 6, num 7, num 8, num 9, num 10, num 11, num 12, num 13, thread 'main' panicked at 'assertion failed: `(left == right)`
left: `"\n [ Тераса ]\n |\n +----N----+\nВход - | Дневна | - Кухня\n +----S----+\n |\n [ Баня ]"`,
right: `"\n [ Тераса ]\n |\n +----N----+\nВход - | Дневна | - Кухня\n +----S----+\n |\n [ Баня ]"`', tests/solution_test.rs:45:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
solution_test::test_cyrillic
test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: test failed, to rerun pass '--test solution_test'
Compiling solution v0.1.0 (/tmp/d20220120-3533338-ddsxdc/solution)
warning: function `padString` should have a snake case name
--> src/lib.rs:12:4
|
12 | fn padString (str: &mut String, pad: usize) {
| ^^^^^^^^^ help: convert the identifier to snake case: `pad_string`
|
= note: `#[warn(non_snake_case)]` on by default
warning: function `separatorLine` should have a snake case name
--> src/lib.rs:20:4
|
20 | fn separatorLine (length: usize, center: char) -> String {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `separator_line`
warning: unused `Result` that must be used
--> src/lib.rs:44:9
|
44 | write!(f, "\n");
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:54:9
|
54 | write!(f, "{}\n", north_row);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:58:9
|
58 | write!(f, "{}\n", pipe_row);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:62:9
|
62 | write!(f, "{}\n", separator_row);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:64:9
|
64 | / match self.name.len() % 2 == 0 {
65 | | true => write!(f, "{} - | {} | - {}\n", self.west, self.name, self.east),
66 | | false => write!(f, "{} - | {} | - {}\n", self.west, self.name, self.east)
67 | | };
| |__________^
|
= note: this `Result` may be an `Err` variant, which should be handled
warning: unused `Result` that must be used
--> src/lib.rs:71:9
|
71 | write!(f, "{}\n", separator_row);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:73:9
|
73 | write!(f, "{}\n", pipe_row);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused `Result` that must be used
--> src/lib.rs:83:9
|
83 | write!(f, "{}", south_row);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: `solution` (lib) generated 10 warnings
Finished test [unoptimized + debuginfo] target(s) in 1.62s
Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c)
running 3 tests
test solution_test::test_basic ... ok
test solution_test::test_cyrillic ... FAILED
test solution_test::test_short ... ok
failures:
---- solution_test::test_cyrillic stdout ----
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `"\n [ Тераса ]\n |\n +-------N-------+\nВход - | Дневна | - Кухня\n +-------S-------+\n |\n [ Баня ]"`,
right: `"\n [ Тераса ]\n |\n +----N----+\nВход - | Дневна | - Кухня\n +----S----+\n |\n [ Баня ]"`', tests/solution_test.rs:45:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
solution_test::test_cyrillic
test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: test failed, to rerun pass '--test solution_test'