]> git.lizzy.rs Git - rust.git/blobdiff - library/alloc/src/collections/linked_list.rs
Auto merge of #96803 - jyn514:faster-assemble, r=Mark-Simulacrum
[rust.git] / library / alloc / src / collections / linked_list.rs
index 736b38370ab87929a5b9b60efec2bf5cd2de4142..67dc4f30f3179c9d6681f900443cf224f2ac8f5a 100644 (file)
@@ -1944,7 +1944,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: Hash> Hash for LinkedList<T> {
     fn hash<H: Hasher>(&self, state: &mut H) {
-        self.len().hash(state);
+        state.write_length_prefix(self.len());
         for elt in self {
             elt.hash(state);
         }