Hi, I called a generic function generic_fun from another function build. But the compiler said it cannot find the function. Any suggestion? Thanks!
pub struct Triangle<T> {
side: T,
}
impl<T> Triangle<T> {
pub fn generic_fun(side: T) -> bool {
true
}
pub fn build(side: T) -> Option<Self> {
if generic_fun(side) {
}
None
}
}
fn main() {}
error[E0425]: cannot find function `generic_fun` in this scope
--> src\main.rs:10:12
|
10 | if generic_fun(side) {
| ^^^^^^^^^^^ not found in this scope