Skip to content

Commit 62b8222

Browse files
committed
Added clippy suggestions
1 parent ccba7cf commit 62b8222

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/juno_module_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl JunoModuleImpl {
3434
if !functions.contains_key(&function) {
3535
return Err(Error::FromJuno(utils::errors::UNKNOWN_FUNCTION));
3636
}
37-
let function = functions[&function].clone();
37+
let function = functions[&function];
3838
drop(functions);
3939
Ok(function(arguments))
4040
}

src/protocol/json_protocol.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ pub fn decode(protocol: &BaseProtocol, data: Buffer) -> BaseMessage {
168168
match protocol {
169169
BaseProtocol::JsonProtocol { .. } => {
170170
let message = decode_internal(&data);
171-
if message.is_none() {
171+
if let Some(message) = message {
172+
message
173+
} else {
172174
BaseMessage::Unknown {
173175
request_id: String::default(),
174176
}
175-
} else {
176-
message.unwrap()
177177
}
178178
}
179179
_ => panic!("BaseProtocol tried to decode a non-JsonProtocol as a JsonProtocol"),

0 commit comments

Comments
 (0)