chiark / gitweb /
Clippy fix: rename Config::default().
authorSimon Tatham <anakin@pobox.com>
Sat, 6 Jan 2024 08:50:12 +0000 (08:50 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 6 Jan 2024 08:53:31 +0000 (08:53 +0000)
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.

src/config.rs
src/main.rs

index bd26ad6bdc8de3d420d7369ea8c36ee4033b700b..61895af30e77dc25e7a41c401567d2e79f02fb5a 100644 (file)
@@ -65,7 +65,7 @@ pub struct ConfigLocation {
 
 impl ConfigLocation {
     #[cfg(unix)]
-    pub fn default() -> Result<Self, ConfigError> {
+    pub fn default_loc() -> Result<Self, ConfigError> {
         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<Self, ConfigError> {
+    pub fn default_loc() -> Result<Self, ConfigError> {
         let appdata = std::env::var("APPDATA")?;
         let mut dir = PathBuf::from_str(&appdata)?;
         dir.push("mastodonochrome");
index 7ec6ba2c8e76ed9b70a6a536bbe035ace524d819..7bee2fb500226c1a6349a9eb02c7710dc8a32653 100644 (file)
@@ -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 {