mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
refactor: remove dead code (#3337)
This commit is contained in:
1 parent
a19002652b
commit
93d1f8af46
1527 files changed
+21170
-73846
No files matched your search
@@ -70,10 +70,6 @@ impl OutputFormat {
|
||||
pub const fn cache_serialization(self) -> &'static str {
|
||||
self.extension()
|
||||
}
|
||||
|
||||
pub const fn supports_animation(self) -> bool {
|
||||
matches!(self, Self::WebP | Self::GIF | Self::APNG)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
@@ -95,10 +91,6 @@ pub fn is_output_format_supported(ext: AssetExtension) -> bool {
|
||||
OutputFormat::from_source_extension(ext).is_some()
|
||||
}
|
||||
|
||||
pub fn coerce_unsupported_format(ext: AssetExtension) -> AssetExtension {
|
||||
OutputFormat::coerce_from_extension(ext).as_asset_extension()
|
||||
}
|
||||
|
||||
pub fn select_url_variant(input: Input) -> OutputSelection {
|
||||
let requested = input.manual_format_override.unwrap_or(input.original);
|
||||
OutputSelection {
|
||||
@@ -193,7 +185,7 @@ mod tests {
|
||||
assert_eq!(extension.mime(), format.mime());
|
||||
assert_eq!(extension.name(), format.extension());
|
||||
assert_eq!(format.extension(), format.cache_serialization());
|
||||
assert_eq!(extension, coerce_unsupported_format(extension));
|
||||
assert_eq!(format, OutputFormat::coerce_from_extension(extension));
|
||||
}
|
||||
for extension in [
|
||||
AssetExtension::Avif,
|
||||
@@ -208,16 +200,10 @@ mod tests {
|
||||
OutputFormat::WebP,
|
||||
OutputFormat::coerce_from_extension(extension)
|
||||
);
|
||||
assert_eq!(AssetExtension::Webp, coerce_unsupported_format(extension));
|
||||
assert_eq!(
|
||||
AssetExtension::Webp,
|
||||
OutputFormat::coerce_from_extension(extension).as_asset_extension()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_the_animation_containers_support_animation() {
|
||||
assert!(OutputFormat::WebP.supports_animation());
|
||||
assert!(OutputFormat::GIF.supports_animation());
|
||||
assert!(OutputFormat::APNG.supports_animation());
|
||||
assert!(!OutputFormat::PNG.supports_animation());
|
||||
assert!(!OutputFormat::JPEG.supports_animation());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user