mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
clippy: Fix a variety of clippy warnings in fonts
, layout_2020
and the DOM code (#33894)
* fixed some clippy warnings Signed-off-by: L Ashwin B <lashwinib@gmail.com> * Delete extra file Signed-off-by: chickenleaf <lashwinib@gmail.com> * preserved newline in compositionevent.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: chickenleaf <lashwinib@gmail.com> * removed the newline in PrototypeList Signed-off-by: L Ashwin B <lashwinib@gmail.com> * removed the trailing whitespace Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com> Signed-off-by: chickenleaf <lashwinib@gmail.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
af6154cf63
commit
1ae90dcd95
7 changed files with 6 additions and 2 deletions
|
@ -6,7 +6,6 @@
|
||||||
// information for an approach that we'll likely need to take when the
|
// information for an approach that we'll likely need to take when the
|
||||||
// renderer moves to a sandboxed process.
|
// renderer moves to a sandboxed process.
|
||||||
|
|
||||||
use std::cmp::{max, min};
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
|
@ -241,6 +241,7 @@ pub(crate) trait ComputedValuesExt {
|
||||||
box_size: LogicalVec2<Size<Au>>,
|
box_size: LogicalVec2<Size<Au>>,
|
||||||
pbm: &PaddingBorderMargin,
|
pbm: &PaddingBorderMargin,
|
||||||
) -> LogicalVec2<Size<Au>>;
|
) -> LogicalVec2<Size<Au>>;
|
||||||
|
#[allow(clippy::type_complexity)]
|
||||||
fn content_box_sizes_and_padding_border_margin(
|
fn content_box_sizes_and_padding_border_margin(
|
||||||
&self,
|
&self,
|
||||||
containing_block: &IndefiniteContainingBlock,
|
containing_block: &IndefiniteContainingBlock,
|
||||||
|
|
|
@ -7935,6 +7935,7 @@ class GlobalGenRoots():
|
||||||
CGGeneric(AUTOGENERATED_WARNING_COMMENT),
|
CGGeneric(AUTOGENERATED_WARNING_COMMENT),
|
||||||
CGGeneric(f"pub const PROTO_OR_IFACE_LENGTH: usize = {len(protos) + len(constructors)};\n"),
|
CGGeneric(f"pub const PROTO_OR_IFACE_LENGTH: usize = {len(protos) + len(constructors)};\n"),
|
||||||
CGGeneric(f"pub const MAX_PROTO_CHAIN_LENGTH: usize = {config.maxProtoChainLength};\n\n"),
|
CGGeneric(f"pub const MAX_PROTO_CHAIN_LENGTH: usize = {config.maxProtoChainLength};\n\n"),
|
||||||
|
CGGeneric("#[allow(clippy::enum_variant_names)]"),
|
||||||
CGNonNamespacedEnum('ID', protos, 0, deriving="PartialEq, Copy, Clone", repr="u16"),
|
CGNonNamespacedEnum('ID', protos, 0, deriving="PartialEq, Copy, Clone", repr="u16"),
|
||||||
CGNonNamespacedEnum('Constructor', constructors, len(protos),
|
CGNonNamespacedEnum('Constructor', constructors, len(protos),
|
||||||
deriving="PartialEq, Copy, Clone", repr="u16"),
|
deriving="PartialEq, Copy, Clone", repr="u16"),
|
||||||
|
|
|
@ -253,6 +253,7 @@ impl LiveDOMReferences {
|
||||||
/// ptr must be a pointer to a type that implements DOMObject.
|
/// ptr must be a pointer to a type that implements DOMObject.
|
||||||
/// This is not enforced by the type system to reduce duplicated generic code,
|
/// This is not enforced by the type system to reduce duplicated generic code,
|
||||||
/// which is acceptable since this method is internal to this module.
|
/// which is acceptable since this method is internal to this module.
|
||||||
|
#[allow(clippy::arc_with_non_send_sync)]
|
||||||
unsafe fn addref(&self, ptr: *const libc::c_void) -> Arc<TrustedReference> {
|
unsafe fn addref(&self, ptr: *const libc::c_void) -> Arc<TrustedReference> {
|
||||||
let mut table = self.reflectable_table.borrow_mut();
|
let mut table = self.reflectable_table.borrow_mut();
|
||||||
let capacity = table.capacity();
|
let capacity = table.capacity();
|
||||||
|
|
|
@ -37,6 +37,7 @@ impl CloseEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
global: &GlobalScope,
|
global: &GlobalScope,
|
||||||
type_: Atom,
|
type_: Atom,
|
||||||
|
|
|
@ -35,6 +35,7 @@ impl CompositionEvent {
|
||||||
reflect_dom_object(Box::new(CompositionEvent::new_inherited()), window)
|
reflect_dom_object(Box::new(CompositionEvent::new_inherited()), window)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
window: &Window,
|
window: &Window,
|
||||||
type_: DOMString,
|
type_: DOMString,
|
||||||
|
|
|
@ -182,7 +182,7 @@ def write_plugin_list(target):
|
||||||
plugins = windows_plugins()
|
plugins = windows_plugins()
|
||||||
print('''/* This is a generated file. Do not modify. */
|
print('''/* This is a generated file. Do not modify. */
|
||||||
|
|
||||||
pub(crate) static GSTREAMER_PLUGINS: &[&'static str] = &[
|
pub(crate) static GSTREAMER_PLUGINS: &[&str] = &[
|
||||||
%s
|
%s
|
||||||
];
|
];
|
||||||
''' % ',\n'.join(map(lambda x: '"' + x + '"', plugins)))
|
''' % ',\n'.join(map(lambda x: '"' + x + '"', plugins)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue