diff options
author | Matthew Rasmus <mattr@zzntd.com> | 2015-01-07 19:07:27 -0800 |
---|---|---|
committer | Matthew Rasmus <mattr@zzntd.com> | 2015-01-08 08:51:11 -0800 |
commit | dc721199985feaf94d23af3e7c5ab2a12e15bcbe (patch) | |
tree | 62111fce4d1cb4dac19ee085f23aeeb67bf526a4 /components/layout/layout_debug.rs | |
parent | 01d4739d168aaa8c3b1ec4b4e6f1ab99a0596251 (diff) | |
download | servo-dc721199985feaf94d23af3e7c5ab2a12e15bcbe.tar.gz servo-dc721199985feaf94d23af3e7c5ab2a12e15bcbe.zip |
Fix `non_upper_case_globals` warnings
Diffstat (limited to 'components/layout/layout_debug.rs')
-rw-r--r-- | components/layout/layout_debug.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs index f16a18e1dfb..94ddad456f6 100644 --- a/components/layout/layout_debug.rs +++ b/components/layout/layout_debug.rs @@ -14,7 +14,7 @@ use std::cell::RefCell; use std::io::File; use std::sync::atomic::{AtomicUint, SeqCst, INIT_ATOMIC_UINT}; -thread_local!(static state_key: RefCell<Option<State>> = RefCell::new(None)) +thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None)) static mut DEBUG_ID_COUNTER: AtomicUint = INIT_ATOMIC_UINT; @@ -59,7 +59,7 @@ struct State { /// will be output at the beginning and end of this scope. impl Scope { pub fn new(name: String) -> Scope { - state_key.with(|ref r| { + STATE_KEY.with(|ref r| { match &mut *r.borrow_mut() { &Some(ref mut state) => { let flow_trace = json::encode(&flow::base(state.flow_root.deref())); @@ -76,7 +76,7 @@ impl Scope { #[cfg(not(ndebug))] impl Drop for Scope { fn drop(&mut self) { - state_key.with(|ref r| { + STATE_KEY.with(|ref r| { match &mut *r.borrow_mut() { &Some(ref mut state) => { let mut current_scope = state.scope_stack.pop().unwrap(); @@ -100,9 +100,9 @@ pub fn generate_unique_debug_id() -> u16 { /// Begin a layout debug trace. If this has not been called, /// creating debug scopes has no effect. pub fn begin_trace(flow_root: FlowRef) { - assert!(state_key.with(|ref r| r.borrow().is_none())); + assert!(STATE_KEY.with(|ref r| r.borrow().is_none())); - state_key.with(|ref r| { + STATE_KEY.with(|ref r| { let flow_trace = json::encode(&flow::base(flow_root.deref())); let state = State { scope_stack: vec![box ScopeData::new("root".into_string(), flow_trace)], @@ -116,7 +116,7 @@ pub fn begin_trace(flow_root: FlowRef) { /// trace to disk in the current directory. The output /// file can then be viewed with an external tool. pub fn end_trace() { - let mut task_state = state_key.with(|ref r| r.borrow_mut().take().unwrap()); + let mut task_state = STATE_KEY.with(|ref r| r.borrow_mut().take().unwrap()); assert!(task_state.scope_stack.len() == 1); let mut root_scope = task_state.scope_stack.pop().unwrap(); root_scope.post = json::encode(&flow::base(task_state.flow_root.deref())); |