diff options
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 9b67077add0..84ee68becc2 100644 --- a/components/layout/layout_debug.rs +++ b/components/layout/layout_debug.rs @@ -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)); + let flow_trace = to_value(&flow::base(&*state.flow_root)).unwrap(); let data = box 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)); + current_scope.post = to_value(&flow::base(&*state.flow_root)).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)); + let flow_trace = to_value(&flow::base(&*flow_root)).unwrap(); let state = State { scope_stack: vec![box 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)); + root_scope.post = to_value(&flow::base(&*thread_state.flow_root)).unwrap(); let result = to_string(&root_scope).unwrap(); let mut file = File::create(format!("layout_trace-{}.json", generation)).unwrap(); |