From d96d3797a4674e2cb5dfee9594a886ef5aacf3ef Mon Sep 17 00:00:00 2001 From: David Harvey-Macaulay Date: Thu, 9 May 2024 16:51:21 +0100 Subject: [PATCH 1/4] Avoid breaking semver --- src/accessor/util.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/accessor/util.rs b/src/accessor/util.rs index b6d8c872..a9f027bd 100644 --- a/src/accessor/util.rs +++ b/src/accessor/util.rs @@ -114,12 +114,21 @@ impl<'a, T: Item> SparseIter<'a, T> { /// /// Here `base` is allowed to be `None` when the base buffer view is not explicitly specified. pub fn new( + base: Option>, + indices: SparseIndicesIter<'a>, + values: ItemIter<'a, T>, + ) -> Self { + Self::with_base_count(base, 0, indices, values) + } + + /// Supplemental constructor. + pub fn with_base_count( base: Option>, base_count: usize, indices: SparseIndicesIter<'a>, values: ItemIter<'a, T>, ) -> Self { - SparseIter { + Self { base, base_count, indices: indices.peekable(), @@ -354,7 +363,7 @@ impl<'a, 's, T: Item> Iter<'s, T> { ItemIter::new(subslice, stride) }; - Some(Iter::Sparse(SparseIter::new( + Some(Iter::Sparse(SparseIter::with_base_count( base_iter, base_count, index_iter, value_iter, ))) } From 95f6620061999da4e95ef92eb2826d3891f866bd Mon Sep 17 00:00:00 2001 From: David Harvey-Macaulay Date: Thu, 9 May 2024 17:08:54 +0100 Subject: [PATCH 2/4] Add cargo semver-checks to CI --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25da5c54..b117c33e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,9 +22,15 @@ jobs: - name: Tests (default features) run: cargo test --all --release + - name: Tests (all features) run: cargo test --all --all-features --release + - name: Formatting run: cargo fmt --all -- --check + - name: Clippy run: cargo clippy --all-features + + - name: Semantic versioning checks + uses: obi1kenobi/cargo-semver-checks-action@v2 From 0496a51435a26595dcc431cc67f4be80163eeb7a Mon Sep 17 00:00:00 2001 From: David Harvey-Macaulay Date: Thu, 9 May 2024 17:22:18 +0100 Subject: [PATCH 3/4] Version 1.4.1 --- CHANGELOG.md | 21 ++++++++++++++++----- Cargo.toml | 4 ++-- README.md | 2 +- gltf-derive/Cargo.toml | 2 +- gltf-json/Cargo.toml | 4 ++-- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d563b376..116febe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,19 +4,30 @@ Notable changes to this project are documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). -The `gltf` crate adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +The top-level `gltf` crate adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). Historically, semantic versioning has not applied to `gltf-json`. This is planned to change from version 2—see issue #409. ## Unreleased +## [1.4.1] - 2024-05-09 + +### Added + +- New functions `animation::Channel::index` and `animation::Sampler::index`. +- New feature flag `allow_empty_texture` to avoid required extension checks. + ### Fixed -- Fix `attemt to to subtract with overflow`-panic in `size_hint()` of sparse accessor when collecting items. -- Fix incorrect values returned from `size_hint()` in sparse accessor -- Add support to read items from sparse accessor without base buffer view + +- Fix `attempt to to subtract with overflow`-panic in `size_hint()` of sparse accessor when collecting items. +- Fix incorrect values returned from `size_hint()` in sparse accessor. +- Add support to read items from sparse accessor without base buffer view. ### Changed -- Update `image` to `0.25.0`. + +- Update `image` to `0.25.0`. +- Validation will now fail if a glTF documentation requires extensions that are not supported by the crate. ### Removed + - Feature `image_jpeg_rayon` no longer needed, as `image 0.25.0` now uses `zune-jpeg` for jpeg decoding. ## [1.4.0] - 2023-12-17 diff --git a/Cargo.toml b/Cargo.toml index 4f313766..a94a7add 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gltf" -version = "1.4.0" +version = "1.4.1" authors = ["David Harvey-Macaulay "] description = "glTF 2.0 loader" documentation = "https://docs.rs/gltf" @@ -25,7 +25,7 @@ approx = "0.5" [dependencies] base64 = { optional = true, version = "0.13" } byteorder = "1.3" -gltf-json = { path = "gltf-json", version = "1.4.0" } +gltf-json = { path = "gltf-json", version = "=1.4.1" } lazy_static = "1" urlencoding = { optional = true, version = "2.1" } serde_json = { features = ["raw_value"], version = "1.0" } diff --git a/README.md b/README.md index 574d8e52..643d0b4b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ By default, `gltf` ignores all `extras` and `names` included with glTF assets. Y ```toml [dependencies.gltf] -version = "1.2" +version = "1.4" features = ["extras", "names"] ``` diff --git a/gltf-derive/Cargo.toml b/gltf-derive/Cargo.toml index 78c1d97a..30a1c5a7 100644 --- a/gltf-derive/Cargo.toml +++ b/gltf-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gltf-derive" -version = "1.4.0" +version = "1.4.1" authors = ["David Harvey-Macaulay "] description = "Internal macros for the gltf crate" repository = "https://github.com/gltf-rs/gltf" diff --git a/gltf-json/Cargo.toml b/gltf-json/Cargo.toml index ff91e69a..015510df 100644 --- a/gltf-json/Cargo.toml +++ b/gltf-json/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gltf-json" -version = "1.4.0" +version = "1.4.1" authors = ["David Harvey-Macaulay "] description = "JSON parsing for the gltf crate" repository = "https://github.com/gltf-rs/gltf" @@ -9,7 +9,7 @@ edition = "2021" rust-version = "1.61" [dependencies] -gltf-derive = { path = "../gltf-derive", version = "1.4.0" } +gltf-derive = { path = "../gltf-derive", version = "=1.4.1" } serde = "1.0" serde_derive = "1.0" serde_json = { features = ["raw_value"], version = "1.0" } From bb771d5ff8d06255755cd76304756dc1933ba014 Mon Sep 17 00:00:00 2001 From: David Harvey-Macaulay Date: Fri, 10 May 2024 13:12:24 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md Co-authored-by: Kevin Reid --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 116febe8..4bb48aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ The top-level `gltf` crate adheres to [Semantic Versioning](http://semver.org/sp ### Changed - Update `image` to `0.25.0`. -- Validation will now fail if a glTF documentation requires extensions that are not supported by the crate. +- Validation will now fail if a glTF document requires extensions that are not supported by the crate. ### Removed