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.
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(),
}
#[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");
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 {