Skip to content

Commit

Permalink
Merge branch 'tsachi/fix-clippy-1.73-warnings' into release/v20.0.0-r…
Browse files Browse the repository at this point in the history
…c.4.1
  • Loading branch information
tsachiherman committed Oct 19, 2023
2 parents 4ee0fbb + b487627 commit aa76c1a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cmd/crates/soroban-spec-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ impl Spec {
let v: u128 = int
.clone()
.try_into()
.map_err(|_| Error::InvalidValue(Some(ScType::U128)))?;
.map_err(|()| Error::InvalidValue(Some(ScType::U128)))?;
Value::String(v.to_string())
}

Expand All @@ -705,7 +705,7 @@ impl Spec {
let v: i128 = int
.clone()
.try_into()
.map_err(|_| Error::InvalidValue(Some(ScType::I128)))?;
.map_err(|()| Error::InvalidValue(Some(ScType::I128)))?;
Value::String(v.to_string())
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/config/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ impl KeyType {
pub fn list_paths(&self, paths: &[Location]) -> Result<Vec<(String, Location)>, Error> {
Ok(paths
.iter()
.flat_map(|p| self.list(p).unwrap_or(vec![]))
.flat_map(|p| self.list(p).unwrap_or_default())
.collect())
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/contract/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl Cmd {
let contract_address_arg = ScAddress::Contract(Hash(contract_id));
let function_symbol_arg = function
.try_into()
.map_err(|_| Error::FunctionNameTooLong(function.clone()))?;
.map_err(|()| Error::FunctionNameTooLong(function.clone()))?;

let final_args =
parsed_args
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Root {
}
match e.kind() {
ErrorKind::InvalidSubcommand => match plugin::run() {
Ok(_) => Error::Clap(e),
Ok(()) => Error::Clap(e),
Err(e) => Error::Plugin(e),
},
_ => Error::Clap(e),
Expand Down
12 changes: 7 additions & 5 deletions cmd/soroban-cli/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,13 @@ impl Client {

pub async fn verify_network_passphrase(&self, expected: Option<&str>) -> Result<String, Error> {
let server = self.get_network().await?.passphrase;
if expected.is_some() && expected != Some(&server) {
return Err(Error::InvalidNetworkPassphrase {
expected: expected.unwrap().to_string(),
server,
});
if expected != Some(&server) {
if let Some(expected_val) = expected {
return Err(Error::InvalidNetworkPassphrase {
expected: expected_val.to_string(),
server,
});
}
}
Ok(server)
}
Expand Down

0 comments on commit aa76c1a

Please sign in to comment.