Skip to content

Commit 1ae90dc

Browse files
clippy: Fix a variety of clippy warnings in fonts, layout_2020 and the DOM code (servo#33894)
* fixed some clippy warnings Signed-off-by: L Ashwin B <[email protected]> * Delete extra file Signed-off-by: chickenleaf <[email protected]> * preserved newline in compositionevent.rs Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: chickenleaf <[email protected]> * removed the newline in PrototypeList Signed-off-by: L Ashwin B <[email protected]> * removed the trailing whitespace Signed-off-by: L Ashwin B <[email protected]> --------- Signed-off-by: L Ashwin B <[email protected]> Signed-off-by: chickenleaf <[email protected]> Co-authored-by: Martin Robinson <[email protected]>
1 parent af6154c commit 1ae90dc

File tree

7 files changed

+6
-2
lines changed

7 files changed

+6
-2
lines changed

components/fonts/platform/windows/font.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// information for an approach that we'll likely need to take when the
77
// renderer moves to a sandboxed process.
88

9-
use std::cmp::{max, min};
109
use std::fmt;
1110
use std::io::Cursor;
1211
use std::ops::Deref;

components/layout_2020/style_ext.rs

+1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ pub(crate) trait ComputedValuesExt {
241241
box_size: LogicalVec2<Size<Au>>,
242242
pbm: &PaddingBorderMargin,
243243
) -> LogicalVec2<Size<Au>>;
244+
#[allow(clippy::type_complexity)]
244245
fn content_box_sizes_and_padding_border_margin(
245246
&self,
246247
containing_block: &IndefiniteContainingBlock,

components/script/dom/bindings/codegen/CodegenRust.py

+1
Original file line numberDiff line numberDiff line change
@@ -7935,6 +7935,7 @@ def PrototypeList(config):
79357935
CGGeneric(AUTOGENERATED_WARNING_COMMENT),
79367936
CGGeneric(f"pub const PROTO_OR_IFACE_LENGTH: usize = {len(protos) + len(constructors)};\n"),
79377937
CGGeneric(f"pub const MAX_PROTO_CHAIN_LENGTH: usize = {config.maxProtoChainLength};\n\n"),
7938+
CGGeneric("#[allow(clippy::enum_variant_names)]"),
79387939
CGNonNamespacedEnum('ID', protos, 0, deriving="PartialEq, Copy, Clone", repr="u16"),
79397940
CGNonNamespacedEnum('Constructor', constructors, len(protos),
79407941
deriving="PartialEq, Copy, Clone", repr="u16"),

components/script/dom/bindings/refcounted.rs

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ impl LiveDOMReferences {
253253
/// ptr must be a pointer to a type that implements DOMObject.
254254
/// This is not enforced by the type system to reduce duplicated generic code,
255255
/// which is acceptable since this method is internal to this module.
256+
#[allow(clippy::arc_with_non_send_sync)]
256257
unsafe fn addref(&self, ptr: *const libc::c_void) -> Arc<TrustedReference> {
257258
let mut table = self.reflectable_table.borrow_mut();
258259
let capacity = table.capacity();

components/script/dom/closeevent.rs

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ impl CloseEvent {
3737
}
3838
}
3939

40+
#[allow(clippy::too_many_arguments)]
4041
pub fn new(
4142
global: &GlobalScope,
4243
type_: Atom,

components/script/dom/compositionevent.rs

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ impl CompositionEvent {
3535
reflect_dom_object(Box::new(CompositionEvent::new_inherited()), window)
3636
}
3737

38+
#[allow(clippy::too_many_arguments)]
3839
pub fn new(
3940
window: &Window,
4041
type_: DOMString,

python/servo/gstreamer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def write_plugin_list(target):
182182
plugins = windows_plugins()
183183
print('''/* This is a generated file. Do not modify. */
184184
185-
pub(crate) static GSTREAMER_PLUGINS: &[&'static str] = &[
185+
pub(crate) static GSTREAMER_PLUGINS: &[&str] = &[
186186
%s
187187
];
188188
''' % ',\n'.join(map(lambda x: '"' + x + '"', plugins)))

0 commit comments

Comments
 (0)