Change parse_env error type from Debug to impl std::error::Error

This is the more appropriate trait I think and should work well for
most real world use cases.
This commit is contained in:
Lukas Kalbertodt
2022-11-06 11:23:21 +01:00
parent 1e74330f00
commit e2dded17fa
5 changed files with 50 additions and 37 deletions

View File

@@ -6,7 +6,7 @@ use confique::{
},
Config,
};
use std::{collections::HashSet, num::NonZeroU64, path::PathBuf, str::FromStr};
use std::{collections::HashSet, num::NonZeroU64, path::PathBuf, str::FromStr, convert::Infallible};
#[derive(Debug, Config)]
struct Conf {
@@ -45,10 +45,7 @@ enum Format {
Yaml,
}
#[derive(Debug)]
enum Error {}
fn parse_formats(input: &str) -> Result<Vec<Format>, Error> {
fn parse_formats(input: &str) -> Result<Vec<Format>, Infallible> {
let mut result = Vec::new();
if input.contains("toml") {