Why I cannot access path field? Can I do something with that?
use std::borrow::Borrow;
struct Node{
path: String,
}
fn foo<T: Borrow<Node>>(a: T) {
let x = a.path;
}
fn main(){
let node = Node {path:"test".to_string()};
foo(&node);
foo(&mut node);
}
error[E0609]: no field `path` on type `T`
--> src/main.rs:8:15
|
7 | fn foo<T: Borrow<Node>>(a: T) {
| - type parameter 'T' declared here
8 | let x = a.path;
| ^^^^