1
Fork 0
mirror of https://github.com/Steffo99/micronfig.git synced 2024-12-23 04:24:18 +00:00

Fix clippy lint about autoderefs

This commit is contained in:
Steffo 2024-12-18 17:38:04 +01:00
parent 3d6ba7f31f
commit 4da9dea5d6
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ pub fn parse_dotenv<P>(value: P) -> Option<DotEnv>
let mut contents: String = String::new(); let mut contents: String = String::new();
file.read_to_string(&mut contents) file.read_to_string(&mut contents)
.expect(&*format!("to be able to read {value:?}")); .expect(&format!("to be able to read {value:?}"));
let mut keys: HashMap<OsString, String> = HashMap::new(); let mut keys: HashMap<OsString, String> = HashMap::new();

View file

@ -13,11 +13,11 @@ pub fn get(key: &OsStr) -> Option<String> {
let path = std::path::PathBuf::from(path); let path = std::path::PathBuf::from(path);
let mut file = std::fs::File::open(&path) let mut file = std::fs::File::open(&path)
.expect(&*format!("to be able to open file at {path:?}")); .expect(&format!("to be able to open file at {path:?}"));
let mut data = String::new(); let mut data = String::new();
file.read_to_string(&mut data) file.read_to_string(&mut data)
.expect(&*format!("to be able to read from file at {path:?}")); .expect(&format!("to be able to read from file at {path:?}"));
Some(data) Some(data)
} }