mirror of
https://github.com/servo/servo.git
synced 2025-09-30 16:49:16 +01:00
Fix existing syntactics nits.
This commit is contained in:
parent
7f935f010b
commit
8bb853f643
93 changed files with 393 additions and 397 deletions
|
@ -212,7 +212,7 @@ impl Window {
|
|||
MouseScrollDelta::PixelDelta(_, dy) => dy
|
||||
};
|
||||
if dy < 0.0 {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::PinchZoom(1.0/1.1));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::PinchZoom(1.0 / 1.1));
|
||||
} else if dy > 0.0 {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::PinchZoom(1.1));
|
||||
}
|
||||
|
@ -523,7 +523,7 @@ impl WindowMethods for Window {
|
|||
}
|
||||
|
||||
fn create_compositor_channel(window: &Option<Rc<Window>>)
|
||||
-> (Box<CompositorProxy+Send>, Box<CompositorReceiver>) {
|
||||
-> (Box<CompositorProxy + Send>, Box<CompositorReceiver>) {
|
||||
let (sender, receiver) = channel();
|
||||
|
||||
let window_proxy = match window {
|
||||
|
@ -534,7 +534,7 @@ impl WindowMethods for Window {
|
|||
(box GlutinCompositorProxy {
|
||||
sender: sender,
|
||||
window_proxy: window_proxy,
|
||||
} as Box<CompositorProxy+Send>,
|
||||
} as Box<CompositorProxy + Send>,
|
||||
box receiver as Box<CompositorReceiver>)
|
||||
}
|
||||
|
||||
|
@ -641,7 +641,7 @@ impl WindowMethods for Window {
|
|||
self.event_queue.borrow_mut().push(WindowEvent::Zoom(1.1));
|
||||
}
|
||||
(CMD_OR_CONTROL, Key::Minus) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Zoom(1.0/1.1));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Zoom(1.0 / 1.1));
|
||||
}
|
||||
(CMD_OR_CONTROL, Key::Num0) |
|
||||
(CMD_OR_CONTROL, Key::Kp0) => {
|
||||
|
@ -746,13 +746,13 @@ impl WindowMethods for Window {
|
|||
}
|
||||
|
||||
fn create_compositor_channel(_: &Option<Rc<Window>>)
|
||||
-> (Box<CompositorProxy+Send>, Box<CompositorReceiver>) {
|
||||
-> (Box<CompositorProxy + Send>, Box<CompositorReceiver>) {
|
||||
let (sender, receiver) = channel();
|
||||
|
||||
(box GlutinCompositorProxy {
|
||||
sender: sender,
|
||||
window_proxy: None,
|
||||
} as Box<CompositorProxy+Send>,
|
||||
} as Box<CompositorProxy + Send>,
|
||||
box receiver as Box<CompositorReceiver>)
|
||||
}
|
||||
|
||||
|
@ -818,11 +818,11 @@ impl CompositorProxy for GlutinCompositorProxy {
|
|||
window_proxy.wakeup_event_loop()
|
||||
}
|
||||
}
|
||||
fn clone_compositor_proxy(&self) -> Box<CompositorProxy+Send> {
|
||||
fn clone_compositor_proxy(&self) -> Box<CompositorProxy + Send> {
|
||||
box GlutinCompositorProxy {
|
||||
sender: self.sender.clone(),
|
||||
window_proxy: self.window_proxy.clone(),
|
||||
} as Box<CompositorProxy+Send>
|
||||
} as Box<CompositorProxy + Send>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -202,9 +202,10 @@ fn read_input_device(device_path: &Path,
|
|||
let cur_dist = dist(slotA.x, slotB.x, slotA.y, slotB.y);
|
||||
println!("Zooming {} {} {} {}",
|
||||
cur_dist, last_dist, screen_dist,
|
||||
((screen_dist + (cur_dist - last_dist))/screen_dist));
|
||||
((screen_dist + (cur_dist - last_dist)) / screen_dist));
|
||||
sender.send(
|
||||
WindowEvent::Zoom((screen_dist + (cur_dist - last_dist))/screen_dist)).ok().unwrap();
|
||||
WindowEvent::Zoom((screen_dist + (cur_dist - last_dist)) /
|
||||
screen_dist)).ok().unwrap();
|
||||
last_dist = cur_dist;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -830,12 +830,12 @@ impl WindowMethods for Window {
|
|||
}
|
||||
|
||||
fn create_compositor_channel(window: &Option<Rc<Window>>)
|
||||
-> (Box<CompositorProxy+Send>, Box<CompositorReceiver>) {
|
||||
-> (Box<CompositorProxy + Send>, Box<CompositorReceiver>) {
|
||||
let (sender, receiver) = channel();
|
||||
(box GonkCompositorProxy {
|
||||
sender: sender,
|
||||
event_sender: window.as_ref().unwrap().event_send.clone(),
|
||||
} as Box<CompositorProxy+Send>,
|
||||
} as Box<CompositorProxy + Send>,
|
||||
box receiver as Box<CompositorReceiver>)
|
||||
}
|
||||
|
||||
|
@ -865,11 +865,11 @@ impl CompositorProxy for GonkCompositorProxy {
|
|||
self.sender.send(msg).ok().unwrap();
|
||||
self.event_sender.send(WindowEvent::Idle).ok().unwrap();
|
||||
}
|
||||
fn clone_compositor_proxy(&self) -> Box<CompositorProxy+Send> {
|
||||
fn clone_compositor_proxy(&self) -> Box<CompositorProxy + Send> {
|
||||
box GonkCompositorProxy {
|
||||
sender: self.sender.clone(),
|
||||
event_sender: self.event_sender.clone(),
|
||||
} as Box<CompositorProxy+Send>
|
||||
} as Box<CompositorProxy + Send>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue