diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-26 17:07:01 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-26 17:07:01 +0100 |
| commit | 39ff8a112e043bd79220df71a74cf0549d75e06a (patch) | |
| tree | 3008f98e5a757feafef8e43964425ef564df058b /src/configuration.rs | |
| parent | 4064639d3c3e25760ef43781feca77332cfbe5eb (diff) | |
Address clippy
Diffstat (limited to 'src/configuration.rs')
| -rw-r--r-- | src/configuration.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/configuration.rs b/src/configuration.rs index 56d60d9..8d79eba 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use serde_json; +use serde_json::{from_str, to_string}; use std::env; use std::fs::{create_dir_all, write, File}; use std::io::{Read, Result}; @@ -65,12 +65,12 @@ impl Configuration { let mut config_file = File::open(&config_file_path).ok()?; let mut config_contents = String::new(); config_file.read_to_string(&mut config_contents).ok()?; - serde_json::from_str(&config_contents).ok()? + from_str(&config_contents).ok()? } fn write(configuration: &Configuration) -> Result<()> { let config_file_path = Configuration::file_path(); - if let Ok(serialized_configuration) = serde_json::to_string(&configuration) { + if let Ok(serialized_configuration) = to_string(&configuration) { write(&config_file_path, serialized_configuration)?; } Ok(()) |