aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_debug.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/layout_debug.rs')
-rw-r--r--components/layout/layout_debug.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs
index ed73a1c693e..79bd12ce8a5 100644
--- a/components/layout/layout_debug.rs
+++ b/components/layout/layout_debug.rs
@@ -6,6 +6,7 @@
//! that can be viewed by an external tool to make layout debugging easier.
#![macro_use]
+#![allow(unsafe_code)] // thread_local!() defines an unsafe function on Android
use flow_ref::FlowRef;
use flow;
@@ -13,7 +14,8 @@ use rustc_serialize::json;
use std::borrow::ToOwned;
use std::cell::RefCell;
-use std::old_io::File;
+use std::io::Write;
+use std::fs::File;
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
@@ -95,7 +97,6 @@ impl Drop for Scope {
/// Generate a unique ID. This is used for items such as Fragment
/// which are often reallocated but represent essentially the
/// same data.
-#[allow(unsafe_blocks)]
pub fn generate_unique_debug_id() -> u16 {
unsafe { DEBUG_ID_COUNTER.fetch_add(1, Ordering::SeqCst) as u16 }
}
@@ -127,5 +128,5 @@ pub fn end_trace() {
let result = json::encode(&root_scope).unwrap();
let path = Path::new("layout_trace.json");
let mut file = File::create(&path).unwrap();
- file.write_str(result.as_slice()).unwrap();
+ file.write_all(result.as_bytes()).unwrap();
}