From 549ef2fc9e3ac1f8cd7af5a0a160c0874db3baf0 Mon Sep 17 00:00:00 2001 From: Maxime Tournier Date: Tue, 15 Apr 2025 10:59:14 +0200 Subject: [PATCH] Change Texture2d::fill to be non-mutable --- src/core/texture/texture2d.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/texture/texture2d.rs b/src/core/texture/texture2d.rs index 7c1a3a3c..c9a3aac5 100644 --- a/src/core/texture/texture2d.rs +++ b/src/core/texture/texture2d.rs @@ -40,7 +40,7 @@ impl Texture2D { cpu_texture: &CpuTexture, data: &[T], ) -> Self { - let mut texture = Self::new_empty::( + let texture = Self::new_empty::( context, cpu_texture.width, cpu_texture.height, @@ -101,7 +101,7 @@ impl Texture2D { /// Will panic if the length of the data does not correspond to the width, height and format specified at construction. /// It is therefore necessary to create a new texture if the texture size or format has changed. /// - pub fn fill(&mut self, data: &[T]) { + pub fn fill(&self, data: &[T]) { check_data_length::(self.width, self.height, 1, self.data_byte_size, data.len()); self.bind(); let mut data = data.to_owned();