mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Simplify some Option / Result / ? operator patterns (#8653)
* Simplify some Option / Result / ? operator patterns When those match a combinator exactly. Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust). * adjust after review * adjust post-review
This commit is contained in:
committed by
GitHub
parent
541692c4a8
commit
052be8bbef
@@ -99,8 +99,7 @@ fn replace_path_dependencies_with_git(cargo_toml_path: &Path, commit_id: &str, c
|
||||
let deps_rewritten = dependencies
|
||||
.iter()
|
||||
.filter_map(|(k, v)| v.clone().try_into::<toml::value::Table>().ok().map(move |v| (k, v)))
|
||||
.filter(|t| t.1.contains_key("path"))
|
||||
.filter(|t| {
|
||||
.filter(|t| t.1.contains_key("path") && {
|
||||
// if the path does not exists, we need to add this as git dependency
|
||||
t.1.get("path").unwrap().as_str().map(|path| !cargo_toml_path.join(path).exists()).unwrap_or(false)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user