Update serde to 0.9 (fixes #15325)

This commit is contained in:
Anthony Ramine 2017-02-10 02:35:26 +01:00
parent 26d6c96b18
commit fe3f4ff0c2
73 changed files with 630 additions and 604 deletions

View file

@ -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();