diff options
author | Aleksandr Likhanov <vegayours@gmail.com> | 2015-11-18 22:27:08 +0500 |
---|---|---|
committer | Aleksandr Likhanov <vegayours@gmail.com> | 2015-11-19 00:48:20 +0500 |
commit | 4bf21ab15e9adb0b1dd8c4d3993d6d3ea4c1c6a3 (patch) | |
tree | 5d535e8dda6045a047b474d9fc23126d73cddeae /components/script/dom/node.rs | |
parent | 2be0cb7827c6553b7dfa4d641bf3a1c72372ad3b (diff) | |
download | servo-4bf21ab15e9adb0b1dd8c4d3993d6d3ea4c1c6a3.tar.gz servo-4bf21ab15e9adb0b1dd8c4d3993d6d3ea4c1c6a3.zip |
reduce node.unique_id size
fix sizeof unittest
update Cargo.lock
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 9c296ac4385..f7b694300af 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -67,7 +67,7 @@ use string_cache::{Atom, Namespace, QualName}; use style::properties::ComputedValues; use util::str::DOMString; use util::task_state; -use uuid; +use uuid::Uuid; // // The basic Node structure @@ -115,7 +115,7 @@ pub struct Node { /// node is finalized. layout_data: LayoutDataRef, - unique_id: DOMRefCell<String>, + unique_id: DOMRefCell<Option<Box<Uuid>>>, } impl PartialEq for Node { @@ -793,11 +793,11 @@ impl Node { } pub fn get_unique_id(&self) -> String { - if self.unique_id.borrow().is_empty() { + if self.unique_id.borrow().is_none() { let mut unique_id = self.unique_id.borrow_mut(); - *unique_id = uuid::Uuid::new_v4().to_simple_string(); + *unique_id = Some(Box::new(Uuid::new_v4())); } - self.unique_id.borrow().clone() + self.unique_id.borrow().as_ref().unwrap().to_simple_string() } pub fn summarize(&self) -> NodeInfo { @@ -1310,7 +1310,7 @@ impl Node { layout_data: LayoutDataRef::new(), - unique_id: DOMRefCell::new(String::new()), + unique_id: DOMRefCell::new(None), } } |