Hi experts, why it says the following and what should I do?
error[E0034]: multiple applicable items in scope
--> src\main.rs:15:27
|
15 | let reference = f.by_ref();
| ^^^^^^ multiple `by_ref` found
|
= note: candidate #1 is defined in an impl of the trait `std::io::Read` for the type `File`
= note: candidate #2 is defined in an impl of the trait `std::io::Write` for the type `File`
here is my code:
use std::fs::File;
use std::io::SeekFrom;
use std::io::prelude::*;
fn main() -> std::io::Result<()> {
let fname = r#"<the-file-path>"#;
let mut f = File::open(fname)?;
f.seek(SeekFrom::Start(678))?;
{
let reference = f.by_ref();
}
Ok(())
}