如何将模具导入铁锈?
1)我有一个包含以下内容的文件:
this_is_stupid.rs
pub mod fix_me {
use crate::InputData;
pub trait Wow {
fn findMe(&self);
}
//impl InputData {
impl Wow for InputData {
fn findMe(&self) {
print!("Really dudes we are working?");
}
} //end impl
} // mod
我的主要观点是:
pub mod this_is_stupid;
use crate::this_is_stupid::fix_me;
pub struct InputData {}
fn main() {
let input_data: InputData{};
fix_me::Wow::findMe();
}
这是我的错误:
error[E0061]: this function takes 1 parameter but 0 parameters were supplied
--> src/main.rs:85:9
|
85 | fix_me::Wow::findMe();
| ^^^^^^^^^^^^^^^^^^^^^ expected 1 parameter
|
::: src/this_is_stupid.rs:12:9
|
12 | fn findMe(&self);
| ----------------- defined here