Fix clippy lints (#2560)

This commit is contained in:
Alphyr 2022-03-28 15:00:09 +02:00 committed by GitHub
parent d45e6b4119
commit 58f318550d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

@ -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) {

View File

@ -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) {
@ -160,7 +160,6 @@ where
None
}
})
.flatten()
}
// Drains uninitialized ranges in a query range.

View File

@ -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));