Skip to content

Commit

Permalink
Allow clippy::redundant_clone false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto committed Jul 11, 2023
1 parent c99ee6b commit 68da2c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2381,12 +2381,14 @@ fn idl_build(no_docs: bool) -> Result<()> {
}

// Convert path to name if there are no conflicts
let path_regex = Regex::new(r#"\"((\w+::)+)(\w+)\""#).unwrap();
let path_regex = Regex::new(r#""((\w+::)+)(\w+)""#).unwrap();
let idls = idls
.into_iter()
.map(|idl| {
let mut modified_content = serde_json::to_string_pretty(&idl).unwrap();

// TODO: Remove. False positive https://github.com/rust-lang/rust-clippy/issues/10577
#[allow(clippy::redundant_clone)]
for captures in path_regex.captures_iter(&modified_content.clone()) {
let path = captures.get(0).unwrap().as_str();
let name = captures.get(3).unwrap().as_str();
Expand Down

0 comments on commit 68da2c9

Please sign in to comment.