mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 13:51:19 +01:00
refactor(config): StaticConfig::read takes &Path, not &PathBuf
clippy::ptr_arg: the function only opens the file, so any path will do, and every caller that passes a &PathBuf still compiles through deref. Needed so the macOS StaticConfigExt methods can take &Path (next revision). Verified: fast-check native, Windows clippy -D warnings, KDE check and lib tests, macOS fake-CC type-check PASS. Verified on the Mini: not yet.
This commit is contained in:
1 parent
ec0d3923e5
commit
1e10f45bb9
1 file changed
+1
-1
@@ -617,7 +617,7 @@ impl StaticConfig {
|
||||
/// # Errors
|
||||
///
|
||||
/// The file cannot be read, or it is not a configuration.
|
||||
pub fn read(path: &PathBuf) -> color_eyre::Result<Self> {
|
||||
pub fn read(path: &std::path::Path) -> color_eyre::Result<Self> {
|
||||
let content = std::fs::read_to_string(path)?;
|
||||
serde_json::from_str(&content).map_err(Into::into)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user