Skip to content

Commit 3d967a6

Browse files
maxime-tournierMaxime Tournier
andauthored
Change Texture2d::fill to be non-mutable (asny#549)
Co-authored-by: Maxime Tournier <maxime.tournier@anatoscope.com>
1 parent be51c35 commit 3d967a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/texture/texture2d.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Texture2D {
4040
cpu_texture: &CpuTexture,
4141
data: &[T],
4242
) -> Self {
43-
let mut texture = Self::new_empty::<T>(
43+
let texture = Self::new_empty::<T>(
4444
context,
4545
cpu_texture.width,
4646
cpu_texture.height,
@@ -101,7 +101,7 @@ impl Texture2D {
101101
/// Will panic if the length of the data does not correspond to the width, height and format specified at construction.
102102
/// It is therefore necessary to create a new texture if the texture size or format has changed.
103103
///
104-
pub fn fill<T: TextureDataType>(&mut self, data: &[T]) {
104+
pub fn fill<T: TextureDataType>(&self, data: &[T]) {
105105
check_data_length::<T>(self.width, self.height, 1, self.data_byte_size, data.len());
106106
self.bind();
107107
let mut data = data.to_owned();

0 commit comments

Comments
 (0)