MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_hash_equivalence

Function check_hash_equivalence

crates/vm/src/dict_inner.rs:1266–1275  ·  view source on GitHub ↗
(text: &str)

Source from the content-addressed store, hash-verified

1264 }
1265
1266 fn check_hash_equivalence(text: &str) {
1267 Interpreter::without_stdlib(Default::default()).enter(|vm| {
1268 let value1 = text;
1269 let value2 = vm.new_pyobj(value1.to_owned());
1270
1271 let hash1 = value1.key_hash(vm).expect("Hash should not fail.");
1272 let hash2 = value2.key_hash(vm).expect("Hash should not fail.");
1273 assert_eq!(hash1, hash2);
1274 })
1275 }
1276}

Callers

nothing calls this directly

Calls 4

new_pyobjMethod · 0.80
key_hashMethod · 0.80
enterMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected