mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Fix match_refs and let_returns in layout, address review changes
This commit is contained in:
parent
5c24da3e2d
commit
8e2c37a542
12 changed files with 54 additions and 62 deletions
|
@ -63,13 +63,13 @@ struct State {
|
|||
impl Scope {
|
||||
pub fn new(name: String) -> Scope {
|
||||
STATE_KEY.with(|ref r| {
|
||||
match &mut *r.borrow_mut() {
|
||||
&mut Some(ref mut state) => {
|
||||
match *r.borrow_mut() {
|
||||
Some(ref mut state) => {
|
||||
let flow_trace = json::encode(&flow::base(&*state.flow_root)).unwrap();
|
||||
let data = box ScopeData::new(name.clone(), flow_trace);
|
||||
state.scope_stack.push(data);
|
||||
}
|
||||
&mut None => {}
|
||||
None => {}
|
||||
}
|
||||
});
|
||||
Scope
|
||||
|
@ -80,14 +80,14 @@ impl Scope {
|
|||
impl Drop for Scope {
|
||||
fn drop(&mut self) {
|
||||
STATE_KEY.with(|ref r| {
|
||||
match &mut *r.borrow_mut() {
|
||||
&mut Some(ref mut state) => {
|
||||
match *r.borrow_mut() {
|
||||
Some(ref mut state) => {
|
||||
let mut current_scope = state.scope_stack.pop().unwrap();
|
||||
current_scope.post = json::encode(&flow::base(&*state.flow_root)).unwrap();
|
||||
let previous_scope = state.scope_stack.last_mut().unwrap();
|
||||
previous_scope.children.push(current_scope);
|
||||
}
|
||||
&mut None => {}
|
||||
None => {}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue