Address Clippy lints
This commit is contained in:
parent
e053e25d2c
commit
15f794b7a8
43 changed files with 147 additions and 172 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -110,10 +110,8 @@ 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)
|
||||
|
|
@ -187,13 +185,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(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue