Download next.js/turbopack/crates/turbopack-trace-server/src/string_tuple_ref.rs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 656 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbopack-trace-server/src/string_tuple_ref.rs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/turbopack/crates/turbopack-trace-server/src/string_tuple_ref.rs
-
curl -L -o string_tuple_ref.rs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbopack-trace-server/src/string_tuple_ref.rs
656 Bytes
| use hashbrown::Equivalent; | |
| pub struct StringTupleRef<'a>(pub &'a str, pub &'a str); | |
| impl<'a> Equivalent<(String, String)> for StringTupleRef<'a> { | |
| fn equivalent(&self, other: &(String, String)) -> bool { | |
| self.0 == other.0 && self.1 == other.1 | |
| } | |
| } | |
| mod string_tuple_ref_tests { | |
| use std::hash::RandomState; | |
| use super::*; | |
| fn test_string_tuple_ref_hash() { | |
| use std::hash::BuildHasher; | |
| let s = RandomState::new(); | |
| assert_eq!( | |
| s.hash_one(StringTupleRef("abc", "def")), | |
| s.hash_one(&("abc".to_string(), "def".to_string())) | |
| ); | |
| } | |
| } | |