aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/fonts/glyph.rs2
-rw-r--r--components/layout/display_list/webrender_helpers.rs18
-rw-r--r--components/layout_2020/flow/inline/mod.rs2
-rw-r--r--components/net/http_cache.rs2
-rw-r--r--components/script/build.rs2
-rw-r--r--components/script/dom/gamepadhapticactuator.rs2
-rw-r--r--components/script/dom/htmlimageelement.rs2
-rw-r--r--components/script/dom/htmllinkelement.rs4
-rw-r--r--components/script/dom/xmlhttprequest.rs2
-rw-r--r--components/script/dom/xrreferencespaceevent.rs8
-rw-r--r--components/script/stylesheet_loader.rs13
-rw-r--r--components/shared/net/fetch/headers.rs4
-rw-r--r--components/shared/net/pub_domains.rs2
13 files changed, 29 insertions, 34 deletions
diff --git a/components/fonts/glyph.rs b/components/fonts/glyph.rs
index 83162da3619..f4a565ff1ea 100644
--- a/components/fonts/glyph.rs
+++ b/components/fonts/glyph.rs
@@ -458,7 +458,7 @@ pub struct GlyphStore {
is_rtl: bool,
}
-impl<'a> GlyphStore {
+impl GlyphStore {
/// Initializes the glyph store, but doesn't actually shape anything.
///
/// Use the `add_*` methods to store glyph data.
diff --git a/components/layout/display_list/webrender_helpers.rs b/components/layout/display_list/webrender_helpers.rs
index b0f75ec413e..487609f2a56 100644
--- a/components/layout/display_list/webrender_helpers.rs
+++ b/components/layout/display_list/webrender_helpers.rs
@@ -252,7 +252,7 @@ impl DisplayItem {
match *self {
DisplayItem::Rectangle(ref mut item) => {
- let mut rect_item = item.item.clone();
+ let mut rect_item = item.item;
rect_item.common = build_common_item_properties(&item.base);
rect_item.bounds = item.item.bounds.translate(stacking_context_offset);
@@ -261,7 +261,7 @@ impl DisplayItem {
IsContentful(false)
},
DisplayItem::Text(ref mut item) => {
- let mut text_item = item.item.clone();
+ let mut text_item = item.item;
text_item.bounds = text_item.bounds.translate(stacking_context_offset);
text_item.common = build_common_item_properties(&item.base);
@@ -277,7 +277,7 @@ impl DisplayItem {
IsContentful(true)
},
DisplayItem::Image(ref mut item) => {
- let mut image_item = item.item.clone();
+ let mut image_item = item.item;
image_item.common = build_common_item_properties(&item.base);
image_item.bounds = item.item.bounds.translate(stacking_context_offset);
@@ -286,7 +286,7 @@ impl DisplayItem {
IsContentful(true)
},
DisplayItem::RepeatingImage(ref mut item) => {
- let mut image_item = item.item.clone();
+ let mut image_item = item.item;
image_item.common = build_common_item_properties(&item.base);
image_item.bounds = item.item.bounds.translate(stacking_context_offset);
@@ -295,7 +295,7 @@ impl DisplayItem {
IsContentful(true)
},
DisplayItem::Border(ref mut item) => {
- let mut border_item = item.item.clone();
+ let mut border_item = item.item;
border_item.common = build_common_item_properties(&item.base);
border_item.bounds = item.item.bounds.translate(stacking_context_offset);
@@ -307,7 +307,7 @@ impl DisplayItem {
IsContentful(false)
},
DisplayItem::Gradient(ref mut item) => {
- let mut gradient_item = item.item.clone();
+ let mut gradient_item = item.item;
gradient_item.common = build_common_item_properties(&item.base);
gradient_item.bounds = item.item.bounds.translate(stacking_context_offset);
@@ -317,7 +317,7 @@ impl DisplayItem {
IsContentful(false)
},
DisplayItem::RadialGradient(ref mut item) => {
- let mut gradient_item = item.item.clone();
+ let mut gradient_item = item.item;
gradient_item.common = build_common_item_properties(&item.base);
gradient_item.bounds = item.item.bounds.translate(stacking_context_offset);
@@ -327,7 +327,7 @@ impl DisplayItem {
IsContentful(false)
},
DisplayItem::Line(ref mut item) => {
- let mut line_item = item.item.clone();
+ let mut line_item = item.item;
line_item.common = build_common_item_properties(&item.base);
line_item.area = item.item.area.translate(stacking_context_offset);
@@ -336,7 +336,7 @@ impl DisplayItem {
IsContentful(false)
},
DisplayItem::BoxShadow(ref mut item) => {
- let mut shadow_item = item.item.clone();
+ let mut shadow_item = item.item;
shadow_item.common = build_common_item_properties(&item.base);
shadow_item.box_bounds = item.item.box_bounds.translate(stacking_context_offset);
diff --git a/components/layout_2020/flow/inline/mod.rs b/components/layout_2020/flow/inline/mod.rs
index 70998d48d09..8a26e38a466 100644
--- a/components/layout_2020/flow/inline/mod.rs
+++ b/components/layout_2020/flow/inline/mod.rs
@@ -1685,7 +1685,7 @@ impl InlineFormattingContext {
FlowLayout {
fragments: layout.fragments,
- content_block_size: content_block_size,
+ content_block_size,
collapsible_margins_in_children,
baselines: layout.baselines,
}
diff --git a/components/net/http_cache.rs b/components/net/http_cache.rs
index c6049155560..c8ec2be5f62 100644
--- a/components/net/http_cache.rs
+++ b/components/net/http_cache.rs
@@ -182,7 +182,7 @@ fn calculate_response_age(response: &Response) -> Duration {
.get(header::AGE)
.and_then(|age_header| age_header.to_str().ok())
.and_then(|age_string| age_string.parse::<u64>().ok())
- .map(|seconds| Duration::from_secs(seconds))
+ .map(Duration::from_secs)
.unwrap_or_default()
}
diff --git a/components/script/build.rs b/components/script/build.rs
index ea598ae57ff..52ccbbee784 100644
--- a/components/script/build.rs
+++ b/components/script/build.rs
@@ -98,7 +98,7 @@ fn find_python() -> PathBuf {
for name in &candidates {
// Command::new() allows us to omit the `.exe` suffix on windows
- if Command::new(&name)
+ if Command::new(name)
.arg("--version")
.output()
.is_ok_and(|out| out.status.success())
diff --git a/components/script/dom/gamepadhapticactuator.rs b/components/script/dom/gamepadhapticactuator.rs
index a0aa8c562d1..008cc5c9216 100644
--- a/components/script/dom/gamepadhapticactuator.rs
+++ b/components/script/dom/gamepadhapticactuator.rs
@@ -96,7 +96,7 @@ impl GamepadHapticActuator {
}
Self {
reflector_: Reflector::new(),
- gamepad_index: gamepad_index,
+ gamepad_index,
effects,
playing_effect_promise: DomRefCell::new(None),
sequence_id: Cell::new(0),
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index 47c833b1b90..dfe7bf39fac 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -7,7 +7,7 @@ use std::collections::HashSet;
use std::default::Default;
use std::rc::Rc;
use std::sync::{Arc, Mutex};
-use std::{char, i32, mem};
+use std::{char, mem};
use app_units::{Au, AU_PER_PX};
use base::id::PipelineId;
diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs
index 856cba42965..df970d498c4 100644
--- a/components/script/dom/htmllinkelement.rs
+++ b/components/script/dom/htmllinkelement.rs
@@ -656,9 +656,7 @@ impl LinkProcessingOptions {
assert!(!self.href.is_empty());
// Step 2. If options's destination is null, then return null.
- let Some(destination) = self.destination else {
- return None;
- };
+ let destination = self.destination?;
// Step 3. Let url be the result of encoding-parsing a URL given options's href, relative to options's base URL.
// TODO: The spec passes a base url which is incompatible with the
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index ab08b3dc86b..26e47e4d23b 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -478,7 +478,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
let name_str = name.as_str().ok_or(Error::Syntax)?;
// Step 5: If (name, value) is a forbidden request-header, then return.
- if is_forbidden_request_header(name_str, &value) {
+ if is_forbidden_request_header(name_str, value) {
return Ok(());
}
diff --git a/components/script/dom/xrreferencespaceevent.rs b/components/script/dom/xrreferencespaceevent.rs
index 075186d91c9..26b3f9b3135 100644
--- a/components/script/dom/xrreferencespaceevent.rs
+++ b/components/script/dom/xrreferencespaceevent.rs
@@ -114,11 +114,9 @@ impl XRReferenceSpaceEventMethods for XRReferenceSpaceEvent {
/// <https://www.w3.org/TR/webxr/#dom-xrreferencespaceevent-transform>
fn GetTransform(&self) -> Option<DomRoot<XRRigidTransform>> {
- if let Some(ref transform) = self.transform {
- Some(DomRoot::from_ref(&**transform))
- } else {
- None
- }
+ self.transform
+ .as_ref()
+ .map(|transform| DomRoot::from_ref(&**transform))
}
/// <https://dom.spec.whatwg.org/#dom-event-istrusted>
diff --git a/components/script/stylesheet_loader.rs b/components/script/stylesheet_loader.rs
index 006bc10b8df..aa876bf3c15 100644
--- a/components/script/stylesheet_loader.rs
+++ b/components/script/stylesheet_loader.rs
@@ -99,13 +99,12 @@ impl FetchResponseListener for StylesheetContext {
fn process_request_eof(&mut self) {}
fn process_response(&mut self, metadata: Result<FetchMetadata, NetworkError>) {
- if let Ok(FetchMetadata::Filtered { ref filtered, .. }) = metadata {
- match *filtered {
- FilteredMetadata::Opaque | FilteredMetadata::OpaqueRedirect(_) => {
- self.origin_clean = false;
- },
- _ => {},
- }
+ if let Ok(FetchMetadata::Filtered {
+ filtered: FilteredMetadata::Opaque | FilteredMetadata::OpaqueRedirect(_),
+ ..
+ }) = metadata
+ {
+ self.origin_clean = false;
}
self.metadata = metadata.ok().map(|m| match m {
diff --git a/components/shared/net/fetch/headers.rs b/components/shared/net/fetch/headers.rs
index 0e1508c5d3e..11bb68d5d0a 100644
--- a/components/shared/net/fetch/headers.rs
+++ b/components/shared/net/fetch/headers.rs
@@ -37,7 +37,7 @@ pub fn get_decode_and_split_header_name(name: &str, headers: &HeaderMap) -> Opti
// Step 1: Let value be the result of getting name from list.
// Step 2: If value is null, then return null.
// Step 3: Return the result of getting, decoding, and splitting value.
- get_value_from_header_list(name, headers).map(|value| get_decode_and_split_header_value(value))
+ get_value_from_header_list(name, headers).map(get_decode_and_split_header_value)
}
/// <https://fetch.spec.whatwg.org/#header-value-get-decode-and-split>
@@ -93,7 +93,7 @@ pub fn get_decode_and_split_header_value(value: Vec<u8>) -> Vec<String> {
temporary_value = String::new();
}
- return values;
+ values
}
/// <https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points>
diff --git a/components/shared/net/pub_domains.rs b/components/shared/net/pub_domains.rs
index 5aa0d47afe4..cbbb2b465b2 100644
--- a/components/shared/net/pub_domains.rs
+++ b/components/shared/net/pub_domains.rs
@@ -28,7 +28,7 @@ pub struct PubDomainRules {
exceptions: HashSet<String>,
}
-static PUB_DOMAINS: LazyLock<PubDomainRules> = LazyLock::new(|| load_pub_domains());
+static PUB_DOMAINS: LazyLock<PubDomainRules> = LazyLock::new(load_pub_domains);
impl<'a> FromIterator<&'a str> for PubDomainRules {
fn from_iter<T>(iter: T) -> Self