diff options
author | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-15 10:57:25 -0700 |
---|---|---|
committer | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-15 11:04:05 -0700 |
commit | 76ed7484eb35d72d62c7cddc5375aed394536066 (patch) | |
tree | 4ec691fa40395e18779a037733e9a5d3ad55efd1 /components/layout/layout_debug.rs | |
parent | afc144aa3974db099ec1e66fc974d8e5ef25f74c (diff) | |
download | servo-76ed7484eb35d72d62c7cddc5375aed394536066.tar.gz servo-76ed7484eb35d72d62c7cddc5375aed394536066.zip |
Use the Deref traits for FlowRefs.
This patch switches FlowRefs to using the Deref and DerefMut traits, instead of
the custom `get` and `get_mut` functions.
Diffstat (limited to 'components/layout/layout_debug.rs')
-rw-r--r-- | components/layout/layout_debug.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs index 1c998e2bc4a..21e2e59324c 100644 --- a/components/layout/layout_debug.rs +++ b/components/layout/layout_debug.rs @@ -62,7 +62,7 @@ impl Scope { match maybe_refcell { Some(refcell) => { let mut state = refcell.borrow_mut(); - let flow_trace = json::encode(&state.flow_root.get()); + let flow_trace = json::encode(&state.flow_root.deref()); let data = box ScopeData::new(name, flow_trace); state.scope_stack.push(data); } @@ -80,7 +80,7 @@ impl Drop for Scope { Some(refcell) => { let mut state = refcell.borrow_mut(); let mut current_scope = state.scope_stack.pop().unwrap(); - current_scope.post = json::encode(&state.flow_root.get()); + current_scope.post = json::encode(&state.flow_root.deref()); let previous_scope = state.scope_stack.last_mut().unwrap(); previous_scope.children.push(current_scope); } @@ -101,7 +101,7 @@ pub fn generate_unique_debug_id() -> uint { pub fn begin_trace(flow_root: FlowRef) { assert!(state_key.get().is_none()); - let flow_trace = json::encode(&flow_root.get()); + let flow_trace = json::encode(&flow_root.deref()); let state = State { scope_stack: vec![box ScopeData::new("root".to_string(), flow_trace)], flow_root: flow_root, @@ -117,7 +117,7 @@ pub fn end_trace() { let mut task_state = task_state_cell.borrow_mut(); assert!(task_state.scope_stack.len() == 1); let mut root_scope = task_state.scope_stack.pop().unwrap(); - root_scope.post = json::encode(&task_state.flow_root.get()); + root_scope.post = json::encode(&task_state.flow_root.deref()); let result = json::encode(&root_scope); let path = Path::new("layout_trace.json"); |