From: Ian Jackson Date: Thu, 31 Mar 2022 19:44:50 +0000 (+0100) Subject: clippy: Miscellaneous minor changes X-Git-Tag: otter-1.0.0~25 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f5f30b733470900d6a13f9488a673e7f83439fdb;p=otter.git clippy: Miscellaneous minor changes Signed-off-by: Ian Jackson --- diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index 79058df0..a544a9c3 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -245,7 +245,7 @@ impl Ctx { assert_eq!( BufReader::new(File::open(ds.subst("@authkeys@")?)?) .lines().nth(2).unwrap().unwrap(), - STATIC_TEST.strip_suffix("\n").unwrap() ); + STATIC_TEST.strip_suffix('\n').unwrap() ); let ssh_command = ds.subst( "@src@/apitest/mock-ssh-restricted @authkeys@ '@dummy_key_data@'" diff --git a/daemon/api.rs b/daemon/api.rs index 2a56c239..27462cf2 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -130,7 +130,7 @@ fn api_piece_op(form: Json>) let loose_conflict = if u_gen <= q_gen { None } else { if ! form.loose { throw!(Inapplicable::Conflict); } - Some(form.op.conflict_loose_check(&gpc, client)?) + Some(form.op.conflict_loose_check(gpc, client)?) }; trace_dbg!("form.op", player, piece, &form.op, &gpc); form.op.check_held(gpc,player)?; @@ -380,7 +380,7 @@ api_route!{ else { None } }; - if gs.pieces.iter().find(|&(opiece, ogpc)| { + if gs.pieces.iter().any(|(opiece, ogpc)| { if ogpc.zlevel < tgpc.zlevel { return false } @@ -392,8 +392,8 @@ api_route!{ else { false } }; return ! cannot_overlap; - }) - .is_some(); + + }); then { let z = gs.max_z.z.clone_mut().increment().map_err(