diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index e48fd990787a9..8c59d40cfe525 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -484,11 +484,10 @@ async fn load_buffers( match buffer.source() { gltf::buffer::Source::Uri(uri) => { if uri.starts_with("data:") { - if uri.starts_with(OCTET_STREAM_URI) { - buffer_data.push(base64::decode(&uri[OCTET_STREAM_URI.len()..])?); - } else { - return Err(GltfError::BufferFormatUnsupported); - } + buffer_data.push(base64::decode( + uri.strip_prefix(OCTET_STREAM_URI) + .ok_or(GltfError::BufferFormatUnsupported)?, + )?); } else { // TODO: Remove this and add dep let buffer_path = asset_path.parent().unwrap().join(uri); diff --git a/docs/linters.md b/docs/linters.md index aefbdaa562853..168021677c9d9 100644 --- a/docs/linters.md +++ b/docs/linters.md @@ -18,7 +18,6 @@ cargo clippy --all-targets --all-features -- -D warnings -A clippy::type_complex * `-D warnings`: No warnings are allowed in the codebase. * `-A clippy::type_complexity`: type complexity must be ignored because we use huge templates for queries. -* `-A clippy::manual-strip`: strip_prefix support was added in 1.45. We want to support earlier rust versions. ## [super-linter](https://github.com/github/super-linter) diff --git a/tools/ci/src/main.rs b/tools/ci/src/main.rs index fd2eea77f7586..35a4f876a0fe1 100644 --- a/tools/ci/src/main.rs +++ b/tools/ci/src/main.rs @@ -13,8 +13,7 @@ fn main() { // See if clippy has any complaints. // - Type complexity must be ignored because we use huge templates for queries - // - `-A clippy::manual-strip` strip_prefix support was added in 1.45 - cmd!("cargo clippy --workspace --all-targets --all-features -- -D warnings -A clippy::type_complexity -A clippy::manual-strip") + cmd!("cargo clippy --workspace --all-targets --all-features -- -D warnings -A clippy::type_complexity") .run() .expect("Please fix clippy errors in output above."); }