Skip to content

Commit

Permalink
Fix clippy lints (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1phyr authored Mar 28, 2022
1 parent d45e6b4 commit 58f3185
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion wgpu-core/src/device/life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ impl<A: hal::Api> LifetimeTracker<A> {
.active
.iter()
.position(|a| a.index > last_done)
.unwrap_or_else(|| self.active.len());
.unwrap_or(self.active.len());

let mut work_done_closures = SmallVec::new();
for a in self.active.drain(..done_count) {
Expand Down
3 changes: 1 addition & 2 deletions wgpu-core/src/init_tracker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ where
.partition_point(|r| r.end <= query_range.start);
self.uninitialized_ranges
.get(index)
.map(|start_range| {
.and_then(|start_range| {
if start_range.start < query_range.end {
let start = start_range.start.max(query_range.start);
match self.uninitialized_ranges.get(index + 1) {
Expand All @@ -160,7 +160,6 @@ where
None
}
})
.flatten()
}

// Drains uninitialized ranges in a query range.
Expand Down
3 changes: 1 addition & 2 deletions wgpu/examples/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ async fn setup<E: Example>(title: &str) -> Setup {
use winit::platform::web::WindowExtWebSys;
let query_string = web_sys::window().unwrap().location().search().unwrap();
let level: log::Level = parse_url_query_string(&query_string, "RUST_LOG")
.map(|x| x.parse().ok())
.flatten()
.and_then(|x| x.parse().ok())
.unwrap_or(log::Level::Error);
console_log::init_with_level(level).expect("could not initialize logger");
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
Expand Down

0 comments on commit 58f3185

Please sign in to comment.