Skip to content

Commit 673f8ea

Browse files
committed
Implement From<&Atom> for Atom.
Needed to do more complex stuff in selectors with local names and namespace urls.
1 parent a955aba commit 673f8ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)