Skip to content

Commit

Permalink
Snake case feature name
Browse files Browse the repository at this point in the history
  • Loading branch information
alteous committed Apr 26, 2024
1 parent 3a43ea6 commit 94d4b1a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ version = "0.25"

[features]
default = ["import", "utils", "names"]
allow-empty-texture = ["gltf-json/allow-empty-texture"]
allow_empty_texture = ["gltf-json/allow_empty_texture"]
extensions = ["gltf-json/extensions"]
extras = ["gltf-json/extras"]
names = ["gltf-json/names"]
Expand Down
2 changes: 1 addition & 1 deletion gltf-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ serde_json = { features = ["raw_value"], version = "1.0" }

[features]
default = []
allow-empty-texture = []
allow_empty_texture = []
names = []
extensions = []
extras = []
Expand Down
6 changes: 3 additions & 3 deletions gltf-json/src/extensions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ pub const ENABLED_EXTENSIONS: &[&str] = &[
#[cfg(feature = "KHR_materials_emissive_strength")]
"KHR_materials_emissive_strength",
// Allowlisted texture extensions. Processing is delegated to the user.
#[cfg(feature = "allow-empty-texture")]
#[cfg(feature = "allow_empty_texture")]
"KHR_texture_basisu",
#[cfg(feature = "allow-empty-texture")]
#[cfg(feature = "allow_empty_texture")]
"EXT_texture_webp",
#[cfg(feature = "allow-empty-texture")]
#[cfg(feature = "allow_empty_texture")]
"MSFT_texture_dds",
];

Expand Down
4 changes: 2 additions & 2 deletions gltf-json/src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ where
P: Fn() -> crate::Path,
R: FnMut(&dyn Fn() -> crate::Path, crate::validation::Error),
{
if cfg!(feature = "allow-empty-texture") {
if cfg!(feature = "allow_empty_texture") {
if !source_is_empty(source) {
source.validate(root, path, report);
}
Expand Down Expand Up @@ -467,7 +467,7 @@ mod tests {
errors.push((path(), error));
},
);
if cfg!(feature = "allow-empty-texture") {
if cfg!(feature = "allow_empty_texture") {
assert!(errors.is_empty());
} else {
assert_eq!(1, errors.len());
Expand Down
4 changes: 2 additions & 2 deletions src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl<'a> Texture<'a> {
}

/// Returns the image used by this texture.
#[cfg(feature = "allow-empty-texture")]
#[cfg(feature = "allow_empty_texture")]
pub fn source(&self) -> Option<image::Image<'a>> {
let index = self.json.source.value();
if index == u32::MAX as usize {
Expand All @@ -169,7 +169,7 @@ impl<'a> Texture<'a> {
}

/// Returns the image used by this texture.
#[cfg(not(feature = "allow-empty-texture"))]
#[cfg(not(feature = "allow_empty_texture"))]
pub fn source(&self) -> image::Image<'a> {
self.document
.images()
Expand Down

0 comments on commit 94d4b1a

Please sign in to comment.