mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
clippy: fix several lint warns (#32126)
As seems #31500 still remain opened here's the next partial fix. Fixed list: `unused_mut`, `clippy::needless_borrow`, `clippy::match_ref_pats`, `clippy::borrow_deref_ref`, `clippy::ptr_eq`, `clippy::unnecessary_cast`, `clippy::derivable_impls`, `clippy::collapsible_match`, `clippy::extra_unused_lifetimes`, `clippy::map_clone`, `clippy::manual_filter`. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes are part of #31500. - [x] These changes do not require tests because are only cosmetic.
This commit is contained in:
parent
025a987732
commit
67f239d1ba
17 changed files with 54 additions and 83 deletions
|
@ -89,10 +89,8 @@ impl AudioBufferSourceNode {
|
|||
loop_start: Cell::new(*options.loopStart),
|
||||
loop_end: Cell::new(*options.loopEnd),
|
||||
};
|
||||
if let Some(ref buffer) = options.buffer {
|
||||
if let Some(ref buffer) = buffer {
|
||||
node.SetBuffer(Some(&**buffer))?
|
||||
}
|
||||
if let Some(Some(ref buffer)) = options.buffer {
|
||||
node.SetBuffer(Some(buffer))?;
|
||||
}
|
||||
Ok(node)
|
||||
}
|
||||
|
@ -267,15 +265,10 @@ impl AudioBufferSourceNodeMethods for AudioBufferSourceNode {
|
|||
impl<'a> From<&'a AudioBufferSourceOptions> for AudioBufferSourceNodeOptions {
|
||||
fn from(options: &'a AudioBufferSourceOptions) -> Self {
|
||||
Self {
|
||||
buffer: if let Some(ref buffer) = options.buffer {
|
||||
if let Some(ref buffer) = buffer {
|
||||
(*buffer.get_channels()).clone()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
},
|
||||
buffer: options
|
||||
.buffer
|
||||
.as_ref()
|
||||
.and_then(|b| (*b.as_ref()?.get_channels()).clone()),
|
||||
detune: *options.detune,
|
||||
loop_enabled: options.loop_,
|
||||
loop_end: Some(*options.loopEnd),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue