Fix clippy::manual_let_else
This commit is contained in:
parent
1019d1e518
commit
f8f1a86344
7 changed files with 15 additions and 24 deletions
|
|
@ -7,7 +7,8 @@ clippy --workspace --no-deps -- \
|
|||
-D clippy::default_trait_access \
|
||||
-D clippy::match-wildcard-for-single-variants \
|
||||
-D clippy::redundant-closure-for-method-calls \
|
||||
-D clippy::filter_map_next
|
||||
-D clippy::filter_map_next \
|
||||
-D clippy::manual_let_else
|
||||
"""
|
||||
|
||||
nitpick = """
|
||||
|
|
@ -38,5 +39,8 @@ clippy --workspace --no-deps -- \
|
|||
-A clippy::single_match_else \
|
||||
-A clippy::unreadable_literal \
|
||||
-A clippy::explicit_deref_methods \
|
||||
-A clippy::map_unwrap_or
|
||||
-A clippy::map_unwrap_or \
|
||||
-A clippy::unnested_or_patterns \
|
||||
-A clippy::similar_names \
|
||||
-A clippy::unused_self
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -100,12 +100,9 @@ mod bezier {
|
|||
bounds: Rectangle,
|
||||
cursor: mouse::Cursor,
|
||||
) -> (event::Status, Option<Curve>) {
|
||||
let cursor_position =
|
||||
if let Some(position) = cursor.position_in(bounds) {
|
||||
position
|
||||
} else {
|
||||
return (event::Status::Ignored, None);
|
||||
};
|
||||
let Some(cursor_position) = cursor.position_in(bounds) else {
|
||||
return (event::Status::Ignored, None);
|
||||
};
|
||||
|
||||
match event {
|
||||
Event::Mouse(mouse_event) => {
|
||||
|
|
|
|||
|
|
@ -406,12 +406,9 @@ mod grid {
|
|||
*interaction = Interaction::None;
|
||||
}
|
||||
|
||||
let cursor_position =
|
||||
if let Some(position) = cursor.position_in(bounds) {
|
||||
position
|
||||
} else {
|
||||
return (event::Status::Ignored, None);
|
||||
};
|
||||
let Some(cursor_position) = cursor.position_in(bounds) else {
|
||||
return (event::Status::Ignored, None);
|
||||
};
|
||||
|
||||
let cell = Cell::at(self.project(cursor_position, bounds.size()));
|
||||
let is_populated = self.state.contains(&cell);
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
|
||||
{
|
||||
// We clear the frame
|
||||
let mut render_pass = scene.clear(
|
||||
let mut render_pass = Scene::clear(
|
||||
&view,
|
||||
&mut encoder,
|
||||
program.background_color(),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ impl Scene {
|
|||
}
|
||||
|
||||
pub fn clear<'a>(
|
||||
&self,
|
||||
target: &'a wgpu::TextureView,
|
||||
encoder: &'a mut wgpu::CommandEncoder,
|
||||
background_color: Color,
|
||||
|
|
|
|||
|
|
@ -108,10 +108,7 @@ impl canvas::Program<Message> for SierpinskiGraph {
|
|||
bounds: Rectangle,
|
||||
cursor: mouse::Cursor,
|
||||
) -> (event::Status, Option<Message>) {
|
||||
let cursor_position = if let Some(position) = cursor.position_in(bounds)
|
||||
{
|
||||
position
|
||||
} else {
|
||||
let Some(cursor_position) = cursor.position_in(bounds) else {
|
||||
return (event::Status::Ignored, None);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -47,10 +47,7 @@ async fn user_connected(ws: WebSocket) {
|
|||
});
|
||||
|
||||
while let Some(result) = user_ws_rx.next().await {
|
||||
let msg = match result {
|
||||
Ok(msg) => msg,
|
||||
Err(_) => break,
|
||||
};
|
||||
let Ok(msg) = result else { break };
|
||||
|
||||
let _ = tx.send(msg).await;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue