refactor: adapters configured from config crate

This commit is contained in:
2026-10-25 21:07:19 +01:00
parent 1f724bb064
commit 04f9c13625
45 changed files with 277 additions and 177 deletions

View File

@@ -43,3 +43,15 @@ fn avif_extension() {
fn webp_extension() {
assert_eq!(Format::Webp.extension(), ".webp");
}
#[test]
fn from_config_follows_section() {
let disabled = ::config::ImageConversionConfig::default();
assert!(ConversionConfig::from_config(&disabled).unwrap().is_none());
let enabled = ::config::ImageConversionConfig {
enabled: true,
format: Some("webp".into()),
};
let cfg = ConversionConfig::from_config(&enabled).unwrap().unwrap();
assert_eq!(cfg.format, Format::Webp);
}