1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

clippy fixes for rust 1.52

This commit is contained in:
Emil Ernerfeldt
2021-05-06 20:49:22 +02:00
parent 29668b5128
commit 0d71017ad4
6 changed files with 70 additions and 77 deletions

View File

@@ -303,15 +303,13 @@ impl Painter {
}
pub fn upload_pending_user_textures(&mut self, facade: &dyn glium::backend::Facade) {
for user_texture in &mut self.user_textures {
if let Some(user_texture) = user_texture {
if user_texture.gl_texture.is_none() {
let pixels = std::mem::take(&mut user_texture.pixels);
let format = texture::SrgbFormat::U8U8U8U8;
let mipmaps = texture::MipmapsOption::NoMipmap;
user_texture.gl_texture =
Some(SrgbTexture2d::with_format(facade, pixels, format, mipmaps).unwrap());
}
for user_texture in self.user_textures.iter_mut().flatten() {
if user_texture.gl_texture.is_none() {
let pixels = std::mem::take(&mut user_texture.pixels);
let format = texture::SrgbFormat::U8U8U8U8;
let mipmaps = texture::MipmapsOption::NoMipmap;
user_texture.gl_texture =
Some(SrgbTexture2d::with_format(facade, pixels, format, mipmaps).unwrap());
}
}
}