clippy: Allow too_many_arguments for existing functions (#31974)

* Allow `too_many_arguments` for existing functions

* fix: Surround ASCII with code block in rustdoc
This commit is contained in:
eri 2024-04-02 14:50:45 +02:00 committed by GitHub
parent f613159cba
commit cc082efbfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 86 additions and 64 deletions

View file

@ -330,27 +330,28 @@ impl CanvasState {
pixels
}
//
// drawImage coordinates explained
//
// Source Image Destination Canvas
// +-------------+ +-------------+
// | | | |
// |(sx,sy) | |(dx,dy) |
// | +----+ | | +----+ |
// | | | | | | | |
// | | |sh |---->| | |dh |
// | | | | | | | |
// | +----+ | | +----+ |
// | sw | | dw |
// | | | |
// +-------------+ +-------------+
//
//
// The rectangle (sx, sy, sw, sh) from the source image
// is copied on the rectangle (dx, dy, dh, dw) of the destination canvas
//
// https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
///
/// drawImage coordinates explained
///
/// ```
/// Source Image Destination Canvas
/// +-------------+ +-------------+
/// | | | |
/// |(sx,sy) | |(dx,dy) |
/// | +----+ | | +----+ |
/// | | | | | | | |
/// | | |sh |---->| | |dh |
/// | | | | | | | |
/// | +----+ | | +----+ |
/// | sw | | dw |
/// | | | |
/// +-------------+ +-------------+
/// ```
///
/// The rectangle (sx, sy, sw, sh) from the source image
/// is copied on the rectangle (dx, dy, dh, dw) of the destination canvas
///
/// <https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage>
#[allow(clippy::too_many_arguments)]
fn draw_image_internal(
&self,
@ -594,10 +595,10 @@ impl CanvasState {
}
}
// It is used by DrawImage to calculate the size of the source and destination rectangles based
// on the drawImage call arguments
// source rectangle = area of the original image to be copied
// destination rectangle = area of the destination canvas where the source image is going to be drawn
/// It is used by DrawImage to calculate the size of the source and destination rectangles based
/// on the drawImage call arguments
/// source rectangle = area of the original image to be copied
/// destination rectangle = area of the destination canvas where the source image is going to be drawn
#[allow(clippy::too_many_arguments)]
fn adjust_source_dest_rects(
&self,
@ -844,7 +845,7 @@ impl CanvasState {
)
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createradialgradient
/// <https://html.spec.whatwg.org/multipage/#dom-context-2d-createradialgradient>
#[allow(clippy::too_many_arguments)]
pub fn create_radial_gradient(
&self,
@ -1283,9 +1284,8 @@ impl CanvasState {
)
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata
#[allow(unsafe_code)]
#[allow(clippy::too_many_arguments)]
/// <https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata>
#[allow(unsafe_code, clippy::too_many_arguments)]
pub fn put_image_data_(
&self,
canvas_size: Size2D<u64>,
@ -1381,7 +1381,7 @@ impl CanvasState {
)
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
/// <https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage>
#[allow(clippy::too_many_arguments)]
pub fn draw_image__(
&self,
@ -1653,7 +1653,7 @@ impl CanvasState {
Ok(())
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-ellipse
/// <https://html.spec.whatwg.org/multipage/#dom-context-2d-ellipse>
#[allow(clippy::too_many_arguments)]
pub fn ellipse(
&self,

View file

@ -64,8 +64,7 @@ impl AudioParam {
}
}
#[allow(crown::unrooted_must_root)]
#[allow(clippy::too_many_arguments)]
#[allow(crown::unrooted_must_root, clippy::too_many_arguments)]
pub fn new(
window: &Window,
context: &BaseAudioContext,

View file

@ -50,6 +50,7 @@ impl BluetoothAdvertisingEvent {
}
}
#[allow(clippy::too_many_arguments)]
fn new(
global: &GlobalScope,
proto: Option<HandleObject>,

View file

@ -26,6 +26,7 @@ pub struct BluetoothCharacteristicProperties {
#[allow(non_snake_case)]
impl BluetoothCharacteristicProperties {
#[allow(clippy::too_many_arguments)]
pub fn new_inherited(
broadcast: bool,
read: bool,
@ -51,6 +52,7 @@ impl BluetoothCharacteristicProperties {
}
}
#[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
broadcast: bool,

View file

@ -50,6 +50,7 @@ impl CloseEvent {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,

View file

@ -48,6 +48,7 @@ impl CompositionEvent {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -237,6 +237,7 @@ impl WorkerEventLoopMethods for DedicatedWorkerGlobalScope {
}
impl DedicatedWorkerGlobalScope {
#[allow(clippy::too_many_arguments)]
fn new_inherited(
init: WorkerGlobalScopeInit,
worker_name: DOMString,
@ -274,7 +275,7 @@ impl DedicatedWorkerGlobalScope {
}
}
#[allow(unsafe_code)]
#[allow(unsafe_code, clippy::too_many_arguments)]
pub fn new(
init: WorkerGlobalScopeInit,
worker_name: DOMString,
@ -311,8 +312,8 @@ impl DedicatedWorkerGlobalScope {
unsafe { DedicatedWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
}
#[allow(unsafe_code)]
// https://html.spec.whatwg.org/multipage/#run-a-worker
/// <https://html.spec.whatwg.org/multipage/#run-a-worker>
#[allow(unsafe_code, clippy::too_many_arguments)]
pub fn run_worker_scope(
mut init: WorkerGlobalScopeInit,
worker_url: ServoUrl,

View file

@ -3060,6 +3060,7 @@ pub enum HasBrowsingContext {
}
impl Document {
#[allow(clippy::too_many_arguments)]
pub fn new_inherited(
window: &Window,
has_browsing_context: HasBrowsingContext,
@ -3315,6 +3316,7 @@ impl Document {
))
}
#[allow(clippy::too_many_arguments)]
pub fn new(
window: &Window,
has_browsing_context: HasBrowsingContext,
@ -3348,6 +3350,7 @@ impl Document {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -51,6 +51,7 @@ impl ErrorEvent {
reflect_dom_object_with_proto(Box::new(ErrorEvent::new_inherited()), global, proto)
}
#[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
type_: Atom,
@ -67,6 +68,7 @@ impl ErrorEvent {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,

View file

@ -64,6 +64,7 @@ impl ExtendableMessageEvent {
}
}
#[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
type_: Atom,
@ -87,6 +88,7 @@ impl ExtendableMessageEvent {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,

View file

@ -66,6 +66,7 @@ impl FocusEvent {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -52,6 +52,7 @@ pub struct Gamepad {
}
impl Gamepad {
#[allow(clippy::too_many_arguments)]
fn new_inherited(
gamepad_id: u32,
id: String,

View file

@ -742,6 +742,7 @@ impl FileListener {
}
impl GlobalScope {
#[allow(clippy::too_many_arguments)]
pub fn new_inherited(
pipeline_id: PipelineId,
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,

View file

@ -63,6 +63,7 @@ impl GPUAdapter {
}
}
#[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
channel: WebGPU,

View file

@ -98,6 +98,7 @@ impl GPUBuffer {
}
}
#[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
channel: WebGPU,

View file

@ -114,6 +114,7 @@ pub struct GPUDevice {
}
impl GPUDevice {
#[allow(clippy::too_many_arguments)]
fn new_inherited(
channel: WebGPU,
adapter: &GPUAdapter,
@ -144,6 +145,7 @@ impl GPUDevice {
}
}
#[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
channel: WebGPU,

View file

@ -46,6 +46,7 @@ pub struct GPUTexture {
}
impl GPUTexture {
#[allow(clippy::too_many_arguments)]
fn new_inherited(
texture: WebGPUTexture,
device: &GPUDevice,
@ -74,6 +75,7 @@ impl GPUTexture {
}
}
#[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
texture: WebGPUTexture,

View file

@ -22,6 +22,7 @@ pub struct InputEvent {
}
impl InputEvent {
#[allow(clippy::too_many_arguments)]
fn new(
window: &Window,
proto: Option<HandleObject>,

View file

@ -64,6 +64,7 @@ impl KeyboardEvent {
reflect_dom_object_with_proto(Box::new(KeyboardEvent::new_inherited()), window, proto)
}
#[allow(clippy::too_many_arguments)]
pub fn new(
window: &Window,
type_: DOMString,
@ -99,6 +100,7 @@ impl KeyboardEvent {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -131,6 +131,7 @@ impl MessageEvent {
ev
}
#[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
type_: Atom,
@ -156,6 +157,7 @@ impl MessageEvent {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,

View file

@ -85,6 +85,7 @@ impl MouseEvent {
reflect_dom_object_with_proto(Box::new(MouseEvent::new_inherited()), window, proto)
}
#[allow(clippy::too_many_arguments)]
pub fn new(
window: &Window,
type_: DOMString,
@ -128,6 +129,7 @@ impl MouseEvent {
)
}
#[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -96,6 +96,7 @@ impl MutationRecord {
)
}
#[allow(clippy::too_many_arguments)]
fn new_inherited(
record_type: &str,
target: &Node,

View file

@ -253,8 +253,7 @@ impl ServiceWorkerGlobalScope {
}
}
#[allow(unsafe_code)]
#[allow(clippy::too_many_arguments)]
#[allow(unsafe_code, clippy::too_many_arguments)]
pub fn new(
init: WorkerGlobalScopeInit,
worker_url: ServoUrl,
@ -285,9 +284,8 @@ impl ServiceWorkerGlobalScope {
unsafe { ServiceWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
}
#[allow(unsafe_code)]
// https://w3c.github.io/ServiceWorker/#run-service-worker-algorithm
#[allow(clippy::too_many_arguments)]
/// <https://w3c.github.io/ServiceWorker/#run-service-worker-algorithm>
#[allow(unsafe_code, clippy::too_many_arguments)]
pub fn run_serviceworker_scope(
scope_things: ScopeThings,
own_sender: Sender<ServiceWorkerScriptMsg>,

View file

@ -453,8 +453,7 @@ impl WebGL2RenderingContext {
})
}
#[allow(unsafe_code)]
#[allow(clippy::too_many_arguments)]
#[allow(unsafe_code, clippy::too_many_arguments)]
fn read_pixels_into(
&self,
x: i32,

View file

@ -254,7 +254,7 @@ pub struct TexImage2DValidator<'a> {
}
impl<'a> TexImage2DValidator<'a> {
// TODO: Move data validation logic here.
/// TODO: Move data validation logic here.
#[allow(clippy::too_many_arguments)]
pub fn new(
context: &'a WebGLRenderingContext,