mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 21:48:36 +00:00
Minor clippy fixes
This commit is contained in:
parent
cddef5ee34
commit
c9b03816d4
@ -189,13 +189,13 @@ impl<R: Resources> Renderer<R> {
|
||||
};
|
||||
Ok(Renderer {
|
||||
bundle: Bundle {
|
||||
slice: slice,
|
||||
pso: pso,
|
||||
vertex_buffer: vertex_buffer,
|
||||
out: out,
|
||||
slice,
|
||||
pso,
|
||||
vertex_buffer,
|
||||
out,
|
||||
},
|
||||
index_buffer: index_buffer,
|
||||
textures: textures,
|
||||
index_buffer,
|
||||
textures,
|
||||
})
|
||||
}
|
||||
|
||||
@ -277,8 +277,8 @@ impl<R: Resources> Renderer<R> {
|
||||
};
|
||||
let data = pipe::BorrowedData {
|
||||
vertex_buffer: &self.bundle.vertex_buffer,
|
||||
matrix: matrix,
|
||||
tex: tex,
|
||||
matrix,
|
||||
tex,
|
||||
out: &self.bundle.out,
|
||||
scissor: &scissor,
|
||||
};
|
||||
@ -301,7 +301,8 @@ impl<R: Resources> Renderer<R> {
|
||||
Bind::empty(),
|
||||
)?;
|
||||
}
|
||||
Ok(encoder.update_buffer(&self.bundle.vertex_buffer, vtx_buffer, 0)?)
|
||||
encoder.update_buffer(&self.bundle.vertex_buffer, vtx_buffer, 0)?;
|
||||
Ok(())
|
||||
}
|
||||
fn upload_index_buffer<F: Factory<R>, C: CommandBuffer<R>>(
|
||||
&mut self,
|
||||
@ -318,7 +319,8 @@ impl<R: Resources> Renderer<R> {
|
||||
)?;
|
||||
self.bundle.slice.buffer = self.index_buffer.clone().into_index_buffer(factory);
|
||||
}
|
||||
Ok(encoder.update_buffer(&self.index_buffer, idx_buffer, 0)?)
|
||||
encoder.update_buffer(&self.index_buffer, idx_buffer, 0)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ use glium::program;
|
||||
use glium::texture;
|
||||
use glium::vertex;
|
||||
use glium::{DrawError, IndexBuffer, Program, Surface, Texture2d, VertexBuffer};
|
||||
use imgui::{DrawList, FrameSize, ImDrawIdx, ImDrawVert, ImGui, ImTexture, Textures, Ui};
|
||||
use imgui::{DrawList, FrameSize, ImGui, ImTexture, Textures, Ui};
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
use std::rc::Rc;
|
||||
@ -79,7 +79,7 @@ impl Renderer {
|
||||
let device_objects = DeviceObjects::init(imgui, ctx)?;
|
||||
Ok(Renderer {
|
||||
ctx: Rc::clone(ctx.get_context()),
|
||||
device_objects: device_objects,
|
||||
device_objects,
|
||||
})
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ impl Renderer {
|
||||
];
|
||||
let result = ui.render(|ui, mut draw_data| {
|
||||
draw_data.scale_clip_rects(ui.imgui().display_framebuffer_scale());
|
||||
for draw_list in draw_data.into_iter() {
|
||||
for draw_list in &draw_data {
|
||||
self.render_draw_list(surface, &draw_list, fb_size, matrix)?;
|
||||
}
|
||||
Ok(())
|
||||
@ -237,9 +237,6 @@ impl DeviceObjects {
|
||||
let mut textures = Textures::new();
|
||||
im_gui.set_font_texture_id(textures.insert(texture));
|
||||
|
||||
Ok(DeviceObjects {
|
||||
program: program,
|
||||
textures: textures,
|
||||
})
|
||||
Ok(DeviceObjects { program, textures })
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ use sys;
|
||||
pub struct ImTexture(usize);
|
||||
|
||||
impl ImTexture {
|
||||
pub fn id(&self) -> usize {
|
||||
pub fn id(self) -> usize {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
@ -60,7 +60,7 @@ impl<'ui> Image<'ui> {
|
||||
w: 0.0,
|
||||
};
|
||||
Image {
|
||||
texture_id: texture_id,
|
||||
texture_id,
|
||||
size: size.into(),
|
||||
uv0: DEFAULT_UV0,
|
||||
uv1: DEFAULT_UV1,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user