andy vs. clippy round 3
This commit is contained in:
parent
f0f65c70be
commit
e6cf819bf4
@ -35,8 +35,7 @@ pub fn create_room(id: ClientId,
|
|||||||
return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 20 \nto create Hard rooms.".into())))].into_iter()))
|
return Ok(Box::new(vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("You must be at least level 20 \nto create Hard rooms.".into())))].into_iter()))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// i can't believe you've done this
|
room::Difficulty::Normal => {},
|
||||||
_ => {unreachable!()},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let area = client_location.get_area(id).unwrap();
|
let area = client_location.get_area(id).unwrap();
|
||||||
@ -87,9 +86,7 @@ pub fn join_room(id: ClientId,
|
|||||||
-> Result<Box<dyn Iterator<Item=(ClientId, SendShipPacket)> + Send>, ShipError> {
|
-> Result<Box<dyn Iterator<Item=(ClientId, SendShipPacket)> + Send>, ShipError> {
|
||||||
let client = clients.get(&id).ok_or(ShipError::ClientNotFound(id))?;
|
let client = clients.get(&id).ok_or(ShipError::ClientNotFound(id))?;
|
||||||
let level = level_table.get_level_from_exp(client.character.char_class, client.character.exp);
|
let level = level_table.get_level_from_exp(client.character.char_class, client.character.exp);
|
||||||
let room = rooms.get(pkt.item as usize)
|
let room = rooms.get(pkt.item as usize).ok_or(ShipError::InvalidRoom(pkt.item))?.as_ref().unwrap(); // clippy look what you made me do
|
||||||
.ok_or_else(|| ShipError::InvalidRoom(pkt.item))?.as_ref()
|
|
||||||
.ok_or_else(|| ShipError::InvalidRoom(pkt.item))?;
|
|
||||||
|
|
||||||
match room.mode.difficulty() {
|
match room.mode.difficulty() {
|
||||||
room::Difficulty::Ultimate => {
|
room::Difficulty::Ultimate => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user