Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
parasyte authored and Yatekii committed Jan 27, 2023
1 parent 8df0ce1 commit 6fd2409
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions examples/cube.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ fn main() {
width: 1280.0,
height: 720.0,
});
window.set_title(&format!("imgui-wgpu {}", version));
window.set_title(&format!("imgui-wgpu {version}"));
let size = window.inner_size();

let surface = unsafe { instance.create_surface(&window) };
Expand All @@ -365,8 +365,8 @@ fn main() {
let surface_desc = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format: wgpu::TextureFormat::Bgra8UnormSrgb,
width: size.width as u32,
height: size.height as u32,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
};
Expand Down Expand Up @@ -452,8 +452,8 @@ fn main() {
let surface_desc = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format: wgpu::TextureFormat::Bgra8UnormSrgb,
width: size.width as u32,
height: size.height as u32,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
};
Expand Down Expand Up @@ -488,7 +488,7 @@ fn main() {
let frame = match surface.get_current_texture() {
Ok(frame) => frame,
Err(e) => {
eprintln!("dropped frame: {:?}", e);
eprintln!("dropped frame: {e:?}");
return;
}
};
Expand All @@ -513,7 +513,7 @@ fn main() {
.size([512.0, 512.0], Condition::FirstUseEver)
.build(|| {
new_example_size = Some(ui.content_region_avail());
imgui::Image::new(example_texture_id, new_example_size.unwrap()).build(&ui);
imgui::Image::new(example_texture_id, new_example_size.unwrap()).build(ui);
});

if let Some(size) = new_example_size {
Expand Down Expand Up @@ -551,7 +551,7 @@ fn main() {

if last_cursor != Some(ui.mouse_cursor()) {
last_cursor = Some(ui.mouse_cursor());
platform.prepare_render(&ui, &window);
platform.prepare_render(ui, &window);
}

let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
Expand Down
16 changes: 8 additions & 8 deletions examples/custom-texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn main() {
width: 1280.0,
height: 720.0,
});
window.set_title(&format!("imgui-wgpu {}", version));
window.set_title(&format!("imgui-wgpu {version}"));
let size = window.inner_size();

let surface = unsafe { instance.create_surface(&window) };
Expand Down Expand Up @@ -58,8 +58,8 @@ fn main() {
let surface_desc = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format: wgpu::TextureFormat::Bgra8UnormSrgb,
width: size.width as u32,
height: size.height as u32,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
};
Expand Down Expand Up @@ -149,8 +149,8 @@ fn main() {
let surface_desc = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format: wgpu::TextureFormat::Bgra8UnormSrgb,
width: size.width as u32,
height: size.height as u32,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
};
Expand Down Expand Up @@ -187,7 +187,7 @@ fn main() {
let frame = match surface.get_current_texture() {
Ok(frame) => frame,
Err(e) => {
eprintln!("dropped frame: {:?}", e);
eprintln!("dropped frame: {e:?}");
return;
}
};
Expand All @@ -204,7 +204,7 @@ fn main() {
.build(|| {
ui.text("Hello textures!");
ui.text("Say hello to checker.png");
Image::new(lenna_texture_id, size).build(&ui);
Image::new(lenna_texture_id, size).build(ui);
});
}

Expand All @@ -213,7 +213,7 @@ fn main() {

if last_cursor != Some(ui.mouse_cursor()) {
last_cursor = Some(ui.mouse_cursor());
platform.prepare_render(&ui, &window);
platform.prepare_render(ui, &window);
}

let view = frame
Expand Down
16 changes: 8 additions & 8 deletions examples/hello-world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn main() {
width: 1280.0,
height: 720.0,
});
window.set_title(&format!("imgui-wgpu {}", version));
window.set_title(&format!("imgui-wgpu {version}"));
let size = window.inner_size();

let surface = unsafe { instance.create_surface(&window) };
Expand All @@ -52,8 +52,8 @@ fn main() {
let surface_desc = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format: wgpu::TextureFormat::Bgra8UnormSrgb,
width: size.width as u32,
height: size.height as u32,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
};
Expand Down Expand Up @@ -121,8 +121,8 @@ fn main() {
let surface_desc = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format: wgpu::TextureFormat::Bgra8UnormSrgb,
width: size.width as u32,
height: size.height as u32,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
};
Expand Down Expand Up @@ -158,7 +158,7 @@ fn main() {
let frame = match surface.get_current_texture() {
Ok(frame) => frame,
Err(e) => {
eprintln!("dropped frame: {:?}", e);
eprintln!("dropped frame: {e:?}");
return;
}
};
Expand Down Expand Up @@ -187,7 +187,7 @@ fn main() {
.size([400.0, 200.0], Condition::FirstUseEver)
.position([400.0, 200.0], Condition::FirstUseEver)
.build(|| {
ui.text(format!("Frametime: {:?}", delta_s));
ui.text(format!("Frametime: {delta_s:?}"));
});

ui.show_demo_window(&mut demo_open);
Expand All @@ -198,7 +198,7 @@ fn main() {

if last_cursor != Some(ui.mouse_cursor()) {
last_cursor = Some(ui.mouse_cursor());
platform.prepare_render(&ui, &window);
platform.prepare_render(ui, &window);
}

let view = frame
Expand Down

0 comments on commit 6fd2409

Please sign in to comment.