mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
removed instances of -> () in existing code
This commit is contained in:
parent
b1faaa15dc
commit
d6568e608b
8 changed files with 29 additions and 29 deletions
|
@ -288,7 +288,7 @@ impl Emitter {
|
|||
}
|
||||
}
|
||||
|
||||
fn send(&mut self, markers: Vec<TimelineMarkerReply>) -> () {
|
||||
fn send(&mut self, markers: Vec<TimelineMarkerReply>) {
|
||||
let end_time = PreciseTime::now();
|
||||
let reply = MarkersEmitterReply {
|
||||
type_: "markers".to_owned(),
|
||||
|
|
|
@ -251,7 +251,7 @@ impl BluetoothDeviceMethods for BluetoothDevice {
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-unwatchadvertisements
|
||||
fn UnwatchAdvertisements(&self) -> () {
|
||||
fn UnwatchAdvertisements(&self) {
|
||||
// Step 1.
|
||||
self.watching_advertisements.set(false)
|
||||
// TODO: Step 2.
|
||||
|
|
|
@ -888,7 +888,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-imagesmoothingenabled
|
||||
fn SetImageSmoothingEnabled(&self, value: bool) -> () {
|
||||
fn SetImageSmoothingEnabled(&self, value: bool) {
|
||||
self.state.borrow_mut().image_smoothing_enabled = value;
|
||||
}
|
||||
|
||||
|
|
|
@ -247,8 +247,8 @@ impl TestBindingMethods for TestBinding {
|
|||
Some(ByteStringOrLong::ByteString(ByteString::new(vec!())))
|
||||
}
|
||||
fn SetUnion6AttributeNullable(&self, _: Option<ByteStringOrLong>) {}
|
||||
fn BinaryRenamedMethod(&self) -> () {}
|
||||
fn ReceiveVoid(&self) -> () {}
|
||||
fn BinaryRenamedMethod(&self) {}
|
||||
fn ReceiveVoid(&self) {}
|
||||
fn ReceiveBoolean(&self) -> bool { false }
|
||||
fn ReceiveByte(&self) -> i8 { 0 }
|
||||
fn ReceiveOctet(&self) -> u8 { 0 }
|
||||
|
|
|
@ -18,15 +18,15 @@ impl TestBindingProxyMethods for TestBindingProxy {
|
|||
fn Length(&self) -> u32 { 0 }
|
||||
fn SupportedPropertyNames(&self) -> Vec<DOMString> { vec![] }
|
||||
fn GetNamedItem(&self, _: DOMString) -> DOMString { DOMString::new() }
|
||||
fn SetNamedItem(&self, _: DOMString, _: DOMString) -> () {}
|
||||
fn SetNamedItem(&self, _: DOMString, _: DOMString) {}
|
||||
fn GetItem(&self, _: u32) -> DOMString { DOMString::new() }
|
||||
fn SetItem(&self, _: u32, _: DOMString) -> () {}
|
||||
fn RemoveItem(&self, _: DOMString) -> () {}
|
||||
fn SetItem(&self, _: u32, _: DOMString) {}
|
||||
fn RemoveItem(&self, _: DOMString) {}
|
||||
fn Stringifier(&self) -> DOMString { DOMString::new() }
|
||||
fn IndexedGetter(&self, _: u32) -> Option<DOMString> { None }
|
||||
fn NamedDeleter(&self, _: DOMString) -> () {}
|
||||
fn IndexedSetter(&self, _: u32, _: DOMString) -> () {}
|
||||
fn NamedSetter(&self, _: DOMString, _: DOMString) -> () {}
|
||||
fn NamedDeleter(&self, _: DOMString) {}
|
||||
fn IndexedSetter(&self, _: u32, _: DOMString) {}
|
||||
fn NamedSetter(&self, _: DOMString, _: DOMString) {}
|
||||
fn NamedGetter(&self, _: DOMString) -> Option<DOMString> { None }
|
||||
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ impl VRDisplayMethods for VRDisplay {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/webvr/#dom-vrdisplay-resetpose
|
||||
fn ResetPose(&self) -> () {
|
||||
fn ResetPose(&self) {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.webvr_thread().send(WebVRMsg::ResetPose(self.global().pipeline_id(),
|
||||
self.get_display_id(),
|
||||
|
@ -220,7 +220,7 @@ impl VRDisplayMethods for VRDisplay {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/webvr/#dom-vrdisplay-depthnear
|
||||
fn SetDepthNear(&self, value: Finite<f64>) -> () {
|
||||
fn SetDepthNear(&self, value: Finite<f64>) {
|
||||
self.depth_near.set(*value.deref());
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ impl VRDisplayMethods for VRDisplay {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/webvr/#dom-vrdisplay-depthfar
|
||||
fn SetDepthFar(&self, value: Finite<f64>) -> () {
|
||||
fn SetDepthFar(&self, value: Finite<f64>) {
|
||||
self.depth_far.set(*value.deref());
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,7 @@ impl VRDisplayMethods for VRDisplay {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/webvr/#dom-vrdisplay-cancelanimationframe
|
||||
fn CancelAnimationFrame(&self, handle: u32) -> () {
|
||||
fn CancelAnimationFrame(&self, handle: u32) {
|
||||
if self.presenting.get() {
|
||||
let mut list = self.raf_callback_list.borrow_mut();
|
||||
if let Some(mut pair) = list.iter_mut().find(|pair| pair.0 == handle) {
|
||||
|
@ -364,7 +364,7 @@ impl VRDisplayMethods for VRDisplay {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/webvr/#dom-vrdisplay-submitframe
|
||||
fn SubmitFrame(&self) -> () {
|
||||
fn SubmitFrame(&self) {
|
||||
if !self.presenting.get() {
|
||||
warn!("VRDisplay not presenting");
|
||||
return;
|
||||
|
|
|
@ -27,12 +27,12 @@ macro_rules! impl_arc_ffi {
|
|||
unsafe impl HasArcFFI for $servo_type {}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn $addref(obj: &$gecko_type) -> () {
|
||||
pub unsafe extern "C" fn $addref(obj: &$gecko_type) {
|
||||
<$servo_type>::addref(obj);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn $release(obj: &$gecko_type) -> () {
|
||||
pub unsafe extern "C" fn $release(obj: &$gecko_type) {
|
||||
<$servo_type>::release(obj);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ lazy_static! {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_Initialize() -> () {
|
||||
pub extern "C" fn Servo_Initialize() {
|
||||
// Initialize logging.
|
||||
let mut builder = LogBuilder::new();
|
||||
let default_level = if cfg!(debug_assertions) { "warn" } else { "error" };
|
||||
|
@ -152,7 +152,7 @@ pub extern "C" fn Servo_Initialize() -> () {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_Shutdown() -> () {
|
||||
pub extern "C" fn Servo_Shutdown() {
|
||||
// Clear some static data to avoid shutdown leaks.
|
||||
gecko_properties::shutdown();
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ pub extern "C" fn Servo_StyleWorkerThreadCount() -> u32 {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_Element_ClearData(element: RawGeckoElementBorrowed) -> () {
|
||||
pub extern "C" fn Servo_Element_ClearData(element: RawGeckoElementBorrowed) {
|
||||
GeckoElement(element).clear_data();
|
||||
}
|
||||
|
||||
|
@ -500,7 +500,7 @@ pub extern "C" fn Servo_StyleSheet_GetRules(sheet: RawServoStyleSheetBorrowed) -
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_CssRules_ListTypes(rules: ServoCssRulesBorrowed,
|
||||
result: nsTArrayBorrowed_uintptr_t) -> () {
|
||||
result: nsTArrayBorrowed_uintptr_t) {
|
||||
let rules = RwLock::<CssRules>::as_arc(&rules).read();
|
||||
let iter = rules.0.iter().map(|rule| rule.rule_type() as usize);
|
||||
let (size, upper) = iter.size_hint();
|
||||
|
@ -559,7 +559,7 @@ pub extern "C" fn Servo_CssRules_DeleteRule(rules: ServoCssRulesBorrowed, index:
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_Debug(rule: RawServoStyleRuleBorrowed, result: *mut nsACString) -> () {
|
||||
pub extern "C" fn Servo_StyleRule_Debug(rule: RawServoStyleRuleBorrowed, result: *mut nsACString) {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
let result = unsafe { result.as_mut().unwrap() };
|
||||
write!(result, "{:?}", *rule.read()).unwrap();
|
||||
|
@ -573,26 +573,26 @@ pub extern "C" fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed) -> R
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_SetStyle(rule: RawServoStyleRuleBorrowed,
|
||||
declarations: RawServoDeclarationBlockBorrowed) -> () {
|
||||
declarations: RawServoDeclarationBlockBorrowed) {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
rule.write().block = declarations.clone();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_GetCssText(rule: RawServoStyleRuleBorrowed, result: *mut nsAString) -> () {
|
||||
pub extern "C" fn Servo_StyleRule_GetCssText(rule: RawServoStyleRuleBorrowed, result: *mut nsAString) {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
rule.read().to_css(unsafe { result.as_mut().unwrap() }).unwrap();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_GetSelectorText(rule: RawServoStyleRuleBorrowed, result: *mut nsAString) -> () {
|
||||
pub extern "C" fn Servo_StyleRule_GetSelectorText(rule: RawServoStyleRuleBorrowed, result: *mut nsAString) {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
rule.read().selectors.to_css(unsafe { result.as_mut().unwrap() }).unwrap();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_MediaRule_Debug(rule: RawServoMediaRuleBorrowed, result: *mut nsACString) -> () {
|
||||
pub extern "C" fn Servo_MediaRule_Debug(rule: RawServoMediaRuleBorrowed, result: *mut nsACString) {
|
||||
let rule = RwLock::<MediaRule>::as_arc(&rule);
|
||||
let result = unsafe { result.as_mut().unwrap() };
|
||||
write!(result, "{:?}", *rule.read()).unwrap();
|
||||
|
@ -611,7 +611,7 @@ pub extern "C" fn Servo_MediaRule_GetRules(rule: RawServoMediaRuleBorrowed) -> S
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_MediaRule_GetCssText(rule: RawServoMediaRuleBorrowed, result: *mut nsAString) -> () {
|
||||
pub extern "C" fn Servo_MediaRule_GetCssText(rule: RawServoMediaRuleBorrowed, result: *mut nsAString) {
|
||||
let rule = RwLock::<MediaRule>::as_arc(&rule);
|
||||
rule.read().to_css(unsafe { result.as_mut().unwrap() }).unwrap();
|
||||
}
|
||||
|
@ -712,7 +712,7 @@ pub extern "C" fn Servo_StyleSet_RebuildData(raw_data: RawServoStyleSetBorrowed)
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_Drop(data: RawServoStyleSetOwned) -> () {
|
||||
pub extern "C" fn Servo_StyleSet_Drop(data: RawServoStyleSetOwned) {
|
||||
let _ = data.into_box::<PerDocumentStyleData>();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue