Skip to content

Commit dd6768e

Browse files
fix(ssg): 🐛 implementing the FromStr trait for ShokuninConfig instead of using a custom from_str method
1 parent a0a8204 commit dd6768e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/cmd.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,6 @@ impl ShokuninConfig {
248248
Ok(config)
249249
}
250250

251-
/// Creates a new `ShokuninConfig` instance from command-line arguments.
252-
pub fn from_str(config_str: &str) -> Result<Self, CliError> {
253-
let config: ShokuninConfig = toml::from_str(config_str)?;
254-
config.validate()?;
255-
Ok(config)
256-
}
257251
/// Creates a new `ShokuninConfig` instance from a TOML file.
258252
pub fn validate(&self) -> Result<(), CliError> {
259253
debug!("Validating config: {:?}", self);
@@ -581,7 +575,7 @@ mod tests {
581575
language = "en-GB"
582576
"#;
583577

584-
let config = ShokuninConfig::from_str(config_str);
578+
let config: Result<ShokuninConfig, _> = config_str.parse();
585579
assert!(config.is_ok());
586580
}
587581

0 commit comments

Comments
 (0)