From ea2368c532efe5fc379054db22fcf1d5c1c7c881 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Thu, 8 Aug 2024 15:18:01 +0200 Subject: [PATCH] Switch to cursor_split feature The `cursor_remaining` feature was replaced by that: https://github.com/rust-lang/rust/pull/109174 --- lib/sdk/src/filetype/texture.rs | 5 ++++- lib/sdk/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/sdk/src/filetype/texture.rs b/lib/sdk/src/filetype/texture.rs index 9e309ee..88314ea 100644 --- a/lib/sdk/src/filetype/texture.rs +++ b/lib/sdk/src/filetype/texture.rs @@ -535,6 +535,8 @@ impl Texture { .to_binary(&mut out_data) .wrap_err("Failed to write DX10 header")?; + // If there is stream data, we build the mipmap data from it. + // If not, we take whatever is left in the bundle file. if let Some(stream) = &self.stream { let data = Self::reorder_stream_mipmap( stream, @@ -549,8 +551,9 @@ impl Texture { .write_all(&data) .wrap_err("Failed to write streamed mipmap data")?; } else { + let (_, remaining) = data.split(); out_data - .write_all(data.remaining_slice()) + .write_all(remaining) .wrap_err("Failed to write texture data")?; }; diff --git a/lib/sdk/src/lib.rs b/lib/sdk/src/lib.rs index 5fad6c8..41310fc 100644 --- a/lib/sdk/src/lib.rs +++ b/lib/sdk/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(cursor_remaining)] +#![feature(cursor_split)] #![feature(test)] mod binary;