diff options
Diffstat (limited to 'glow/src')
| -rw-r--r-- | glow/src/backend.rs | 1 | ||||
| -rw-r--r-- | glow/src/lib.rs | 14 | ||||
| -rw-r--r-- | glow/src/program.rs | 2 | ||||
| -rw-r--r-- | glow/src/quad/compatibility.rs | 19 | ||||
| -rw-r--r-- | glow/src/quad/core.rs | 2 | ||||
| -rw-r--r-- | glow/src/text.rs | 5 | 
6 files changed, 21 insertions, 22 deletions
| diff --git a/glow/src/backend.rs b/glow/src/backend.rs index f63135a4..78d4229e 100644 --- a/glow/src/backend.rs +++ b/glow/src/backend.rs @@ -173,7 +173,6 @@ impl Backend {                                  glow_glyph::VerticalAlign::Bottom                              }                          }), -                    ..Default::default()                  };                  self.text_pipeline.queue(text); diff --git a/glow/src/lib.rs b/glow/src/lib.rs index 043c5b13..de9c0002 100644 --- a/glow/src/lib.rs +++ b/glow/src/lib.rs @@ -7,10 +7,18 @@  #![doc(      html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"  )] -#![deny(missing_docs)] -#![deny(missing_debug_implementations)] -#![deny(unused_results)] +#![deny( +    missing_debug_implementations, +    missing_docs, +    unused_results, +    clippy::extra_unused_lifetimes, +    clippy::from_over_into, +    clippy::needless_borrow, +    clippy::new_without_default, +    clippy::useless_conversion +)]  #![forbid(rust_2018_idioms)] +#![allow(clippy::inherent_to_string, clippy::type_complexity)]  #![cfg_attr(docsrs, feature(doc_cfg))]  pub use glow; diff --git a/glow/src/program.rs b/glow/src/program.rs index 9a02d578..1eb9c535 100644 --- a/glow/src/program.rs +++ b/glow/src/program.rs @@ -70,7 +70,7 @@ impl Shader {          unsafe {              let shader = gl.create_shader(stage).expect("Cannot create shader"); -            gl.shader_source(shader, &content); +            gl.shader_source(shader, content);              gl.compile_shader(shader);              if !gl.get_shader_compile_status(shader) { diff --git a/glow/src/quad/compatibility.rs b/glow/src/quad/compatibility.rs index 76f98ab7..eb3fb7e0 100644 --- a/glow/src/quad/compatibility.rs +++ b/glow/src/quad/compatibility.rs @@ -110,22 +110,13 @@ impl Pipeline {          bounds: Rectangle<u32>,      ) {          // TODO: Remove this allocation (probably by changing the shader and removing the need of two `position`) -        let vertices: Vec<Vertex> = instances -            .iter() -            .flat_map(|quad| Vertex::from_quad(quad)) -            .collect(); +        let vertices: Vec<Vertex> = +            instances.iter().flat_map(Vertex::from_quad).collect();          // TODO: Remove this allocation (or allocate only when needed)          let indices: Vec<i32> = (0..instances.len().min(MAX_QUADS) as i32)              .flat_map(|i| { -                [ -                    0 + i * 4, -                    1 + i * 4, -                    2 + i * 4, -                    2 + i * 4, -                    1 + i * 4, -                    3 + i * 4, -                ] +                [i * 4, 1 + i * 4, 2 + i * 4, 2 + i * 4, 1 + i * 4, 3 + i * 4]              })              .cycle()              .take(instances.len() * 6) @@ -187,13 +178,13 @@ impl Pipeline {                  gl.buffer_sub_data_u8_slice(                      glow::ARRAY_BUFFER,                      0, -                    bytemuck::cast_slice(&vertices), +                    bytemuck::cast_slice(vertices),                  );                  gl.buffer_sub_data_u8_slice(                      glow::ELEMENT_ARRAY_BUFFER,                      0, -                    bytemuck::cast_slice(&indices), +                    bytemuck::cast_slice(indices),                  );                  gl.draw_elements( diff --git a/glow/src/quad/core.rs b/glow/src/quad/core.rs index f37300f6..3e51b1ca 100644 --- a/glow/src/quad/core.rs +++ b/glow/src/quad/core.rs @@ -154,7 +154,7 @@ impl Pipeline {                  gl.buffer_sub_data_u8_slice(                      glow::ARRAY_BUFFER,                      0, -                    bytemuck::cast_slice(&instances), +                    bytemuck::cast_slice(instances),                  );                  gl.draw_arrays_instanced( diff --git a/glow/src/text.rs b/glow/src/text.rs index 0d45d61b..37ccdece 100644 --- a/glow/src/text.rs +++ b/glow/src/text.rs @@ -54,7 +54,7 @@ impl Pipeline {          #[cfg(target_arch = "wasm32")]          let draw_brush_builder = draw_brush_builder.draw_cache_align_4x4(true); -        let draw_brush = draw_brush_builder.build(&gl); +        let draw_brush = draw_brush_builder.build(gl);          let measure_brush =              glyph_brush::GlyphBrushBuilder::using_font(font).build(); @@ -180,7 +180,8 @@ impl Pipeline {                  }                  b_count += utf8_len;              } -            return byte_index; + +            byte_index          };          if !nearest_only { | 
