Mam taki kod w Rust.
use ferris_says::say; // from the previous step
//use extern crate ferris_says;
use std::io::{stdout, BufWriter};
pub fn run() {
let stdout = stdout();
let out = b"Hello fellow Rustaceans!";
let width = 24;
let mut writer = BufWriter::new(stdout.lock());
say(out, width, &mut writer).unwrap();
}
Tak wygląda main
mod hello_fellow;
fn main() {
hello_fellow::run();
}
A tak błąd
cargo run
Compiling dcode v0.1.0 (/home/user/Rust/dcode)
error[E0432]: unresolved import `ferris_says`
--> src/hello_fellow.rs:1:5
|
1 | use ferris_says::say; // from the previous step
| ^^^^^^^^^^^ use of undeclared type or module `ferris_
says`
error: aborting due to previous error
For more information about this error, try `rustc --explain E
0432`.
error: Could not compile `dcode`.
To learn more, run the command again with --verbose.