diff --git a/rustywind-core/CHANGELOG.md b/rustywind-core/CHANGELOG.md index 8775102..d1cf742 100644 --- a/rustywind-core/CHANGELOG.md +++ b/rustywind-core/CHANGELOG.md @@ -4,6 +4,7 @@ - Changed `HowClassesAreWrapped` to `ClassWrapping` - Fixed some clippy warnings +- Implemented `Default` for `Options` ## [0.2.0] - 2024-10-21 diff --git a/rustywind-core/src/sorter.rs b/rustywind-core/src/sorter.rs index 10e5436..a98e2ba 100644 --- a/rustywind-core/src/sorter.rs +++ b/rustywind-core/src/sorter.rs @@ -91,6 +91,17 @@ pub struct Options { pub class_wrapping: ClassWrapping, } +impl Default for Options { + fn default() -> Self { + Self { + regex: FinderRegex::DefaultRegex, + sorter: Sorter::DefaultSorter, + allow_duplicates: false, + class_wrapping: ClassWrapping::NoWrapping, + } + } +} + /// Checks if the file contents have any classes. pub fn has_classes(file_contents: &str, options: &Options) -> bool { options.regex.is_match(file_contents)