From: Simon Tatham Date: Sat, 6 Jan 2024 08:50:12 +0000 (+0000) Subject: Clippy fix: rename Config::default(). X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b01a7acb0b3f42c280012e3ec08e091e99502c2f;p=mastodonochrome.git Clippy fix: rename Config::default(). Calling it that, Clippy complains that it looks too much like the method of the Default trait, and suggests I either impl Default or rename the method. For the moment, I'll rename the method; I don't know that I have a good use for impl Default right now. --- diff --git a/src/config.rs b/src/config.rs index bd26ad6..61895af 100644 --- a/src/config.rs +++ b/src/config.rs @@ -65,7 +65,7 @@ pub struct ConfigLocation { impl ConfigLocation { #[cfg(unix)] - pub fn default() -> Result { + pub fn default_loc() -> Result { let base_dirs = xdg::BaseDirectories::with_prefix("mastodonochrome")?; Ok(ConfigLocation { dir: base_dirs.get_config_home(), @@ -73,7 +73,7 @@ impl ConfigLocation { } #[cfg(windows)] - pub fn default() -> Result { + pub fn default_loc() -> Result { let appdata = std::env::var("APPDATA")?; let mut dir = PathBuf::from_str(&appdata)?; dir.push("mastodonochrome"); diff --git a/src/main.rs b/src/main.rs index 7ec6ba2..7bee2fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,7 @@ struct Args { fn main_inner() -> Result<(), TopLevelError> { let cli = Args::try_parse()?; let cfgloc = match cli.config { - None => ConfigLocation::default()?, + None => ConfigLocation::default_loc()?, Some(dir) => ConfigLocation::from_pathbuf(dir), }; let httplogfile = match cli.loghttp {