use 'Self' to refer to own type

This commit is contained in:
daniel.eades 2023-11-16 18:32:31 +00:00 committed by Ashley Wulber
parent a88cbad37f
commit b9723dd5e0
15 changed files with 48 additions and 54 deletions

View file

@ -26,7 +26,7 @@ pub struct AppListConfig {
impl AppListConfig {
// TODO async?
/// load config with the provided name
pub fn load() -> anyhow::Result<AppListConfig> {
pub fn load() -> anyhow::Result<Self> {
let mut relative_path = PathBuf::from(APP_ID);
relative_path.push("config.ron");
let file = match BaseDirectories::new()
@ -40,7 +40,7 @@ impl AppListConfig {
}
};
ron::de::from_reader::<_, AppListConfig>(file)
ron::de::from_reader::<_, Self>(file)
.map_err(|err| anyhow!("Failed to parse config file: {}", err))
}