Skip to content

Commit 2124d55

Browse files
fix(test): drop needless borrows in import-resolution hash encoding
cargo clippy with -D clippy::all rejects the needless reference passed to alloy_primitives::hex::encode_prefixed, whose argument is taken by an AsRef<[u8]> generic bound. Pass the owned hash by value in the imported and nested-imported RainDocument parse tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0c2cd31 commit 2124d55

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • crates/dotrain/src/parser/raindocument

crates/dotrain/src/parser/raindocument/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ _: opcode-1(0xabcd 456);
814814
.unwrap()
815815
.set_dotrain(imported_text, "imported.rain", false)
816816
.unwrap();
817-
let imported_hash_hex = alloy_primitives::hex::encode_prefixed(&imported_hash);
817+
let imported_hash_hex = alloy_primitives::hex::encode_prefixed(imported_hash);
818818

819819
// the importer references the imported dotrain by its hash via the `@` statement
820820
// and additionally declares its own binding
@@ -874,7 +874,7 @@ _: opcode-1(0xabcd 456);
874874
.unwrap()
875875
.set_dotrain(inner_text, "inner.rain", false)
876876
.unwrap();
877-
let inner_hash_hex = alloy_primitives::hex::encode_prefixed(&inner_hash);
877+
let inner_hash_hex = alloy_primitives::hex::encode_prefixed(inner_hash);
878878

879879
// the middle dotrain imports `inner` (nested import) and adds its own binding
880880
let middle_text = format!(
@@ -888,7 +888,7 @@ _: opcode-1(0xabcd 456);
888888
.unwrap()
889889
.set_dotrain(&middle_text, "middle.rain", false)
890890
.unwrap();
891-
let middle_hash_hex = alloy_primitives::hex::encode_prefixed(&middle_hash);
891+
let middle_hash_hex = alloy_primitives::hex::encode_prefixed(middle_hash);
892892

893893
// the top document imports only `middle`, which in turn imports `inner`
894894
let top_text = format!(

0 commit comments

Comments
 (0)