Skip to content

Commit 4a027b0

Browse files
author
bors-servo
authored
Auto merge of #194 - servo:from-ref-self-for-self, r=SimonSapin
Implement From<&Atom> for Atom. Needed to do more complex stuff in selectors with local names and namespace urls. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/string-cache/194) <!-- Reviewable:end -->
2 parents a955aba + 84ed420 commit 4a027b0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "string_cache"
4-
version = "0.6.2" # Also update README.md when making a semver-breaking change
4+
version = "0.6.3" # Also update README.md when making a semver-breaking change
55
authors = [ "The Servo Project Developers" ]
66
description = "A string interning library for Rust, developed as part of the Servo project."
77
license = "MIT / Apache-2.0"

src/atom.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ impl<Static: StaticAtomSet> ::precomputed_hash::PrecomputedHash for Atom<Static>
227227
}
228228
}
229229

230+
impl<'a, Static: StaticAtomSet> From<&'a Atom<Static>> for Atom<Static> {
231+
fn from(atom: &'a Self) -> Self {
232+
atom.clone()
233+
}
234+
}
235+
230236
fn u64_hash_as_u32(h: u64) -> u32 {
231237
// This may or may not be great...
232238
((h >> 32) ^ h) as u32

0 commit comments

Comments
 (0)