diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2017-12-14 10:57:34 -0600 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2017-12-14 12:16:45 -0600 |
commit | c60cfc5a9f49bc7207682a97864d1b3cf9a9a481 (patch) | |
tree | c9dd4375536be970e1790e384b9d83257d025b4c /components/layout/layout_debug.rs | |
parent | 26feea3be5bc70fed7a642ca768187d29469fee0 (diff) | |
download | servo-c60cfc5a9f49bc7207682a97864d1b3cf9a9a481.tar.gz servo-c60cfc5a9f49bc7207682a97864d1b3cf9a9a481.zip |
Turn flow::base and friends into methods
Diffstat (limited to 'components/layout/layout_debug.rs')
-rw-r--r-- | components/layout/layout_debug.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs index 1c9869c2165..466399ca8f0 100644 --- a/components/layout/layout_debug.rs +++ b/components/layout/layout_debug.rs @@ -5,7 +5,7 @@ //! Supports writing a trace file created during each layout scope //! that can be viewed by an external tool to make layout debugging easier. -use flow; +use flow::GetBaseFlow; use flow_ref::FlowRef; use serde_json::{to_string, to_value, Value}; use std::borrow::ToOwned; @@ -63,7 +63,7 @@ impl Scope { pub fn new(name: String) -> Scope { STATE_KEY.with(|ref r| { if let Some(ref mut state) = *r.borrow_mut() { - let flow_trace = to_value(&flow::base(&*state.flow_root)).unwrap(); + let flow_trace = to_value(&state.flow_root.base()).unwrap(); let data = Box::new(ScopeData::new(name.clone(), flow_trace)); state.scope_stack.push(data); } @@ -78,7 +78,7 @@ impl Drop for Scope { STATE_KEY.with(|ref r| { if let Some(ref mut state) = *r.borrow_mut() { let mut current_scope = state.scope_stack.pop().unwrap(); - current_scope.post = to_value(&flow::base(&*state.flow_root)).unwrap(); + current_scope.post = to_value(&state.flow_root.base()).unwrap(); let previous_scope = state.scope_stack.last_mut().unwrap(); previous_scope.children.push(current_scope); } @@ -100,7 +100,7 @@ pub fn begin_trace(flow_root: FlowRef) { assert!(STATE_KEY.with(|ref r| r.borrow().is_none())); STATE_KEY.with(|ref r| { - let flow_trace = to_value(&flow::base(&*flow_root)).unwrap(); + let flow_trace = to_value(&flow_root.base()).unwrap(); let state = State { scope_stack: vec![Box::new(ScopeData::new("root".to_owned(), flow_trace))], flow_root: flow_root.clone(), @@ -116,7 +116,7 @@ pub fn end_trace(generation: u32) { let mut thread_state = STATE_KEY.with(|ref r| r.borrow_mut().take().unwrap()); assert!(thread_state.scope_stack.len() == 1); let mut root_scope = thread_state.scope_stack.pop().unwrap(); - root_scope.post = to_value(&flow::base(&*thread_state.flow_root)).unwrap(); + root_scope.post = to_value(&thread_state.flow_root.base()).unwrap(); let result = to_string(&root_scope).unwrap(); let mut file = File::create(format!("layout_trace-{}.json", generation)).unwrap(); |