Skip to content

Commit 62993ca

Browse files
authored
Merge PR #124 from rustafarian-dev
Add check that only one feature http-types, mime02, or mime03 is enabled
2 parents 35501aa + 27d1e9a commit 62993ca

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ project adheres to
1010

1111
## Unreleased
1212

13+
* Added a check that no more than one of the http-types, mime02, or
14+
mime03 features are enabled (PR #124). Thanks @rustafarian-dev.
1315
* Fixed more clippy lint (PR #123). Thanks @vbrandl!
1416
* Updated `rsass` to 0.28.0 and `itertools` to 0.11.0.
1517

src/staticfiles.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,15 @@ fn name_and_ext(path: &Path) -> Option<(&str, &str)> {
613613
None
614614
}
615615

616+
#[cfg(any(
617+
all(feature = "mime03", feature = "http-types"),
618+
all(feature = "mime02", feature = "http-types"),
619+
all(feature = "mime02", feature = "mime03"),
620+
))]
621+
compile_error!(
622+
r#"Only one of these features "http-types", "mime02" or "mime03" must be enabled at a time."#
623+
);
624+
616625
/// A short and url-safe checksum string from string data.
617626
fn checksum_slug(data: &[u8]) -> String {
618627
use base64::prelude::{Engine, BASE64_URL_SAFE_NO_PAD};

0 commit comments

Comments
 (0)