mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
clippy: Fix warnings in shared
and config
, fonts
, layout
, and layout_2020
components (#32674)
This commit is contained in:
parent
99c1f886b8
commit
4b63043c6a
20 changed files with 72 additions and 78 deletions
|
@ -193,7 +193,7 @@ impl PipelineNamespace {
|
|||
namespace_id_method! {next_blob_id, BlobId, self, BlobIndex}
|
||||
}
|
||||
|
||||
thread_local!(pub static PIPELINE_NAMESPACE: Cell<Option<PipelineNamespace>> = Cell::new(None));
|
||||
thread_local!(pub static PIPELINE_NAMESPACE: Cell<Option<PipelineNamespace>> = const { Cell::new(None) });
|
||||
|
||||
#[derive(
|
||||
Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd, Serialize,
|
||||
|
@ -271,7 +271,8 @@ impl fmt::Display for BrowsingContextGroupId {
|
|||
}
|
||||
}
|
||||
|
||||
thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell<Option<TopLevelBrowsingContextId>> = Cell::new(None));
|
||||
thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell<Option<TopLevelBrowsingContextId>> =
|
||||
const { Cell::new(None) });
|
||||
|
||||
#[derive(
|
||||
Clone, Copy, Deserialize, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd, Serialize,
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#![deny(unsafe_code)]
|
||||
|
||||
use std::fmt::Display;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
use base::id::HistoryStateId;
|
||||
|
@ -118,9 +119,9 @@ pub enum ReferrerPolicy {
|
|||
StrictOriginWhenCrossOrigin,
|
||||
}
|
||||
|
||||
impl ToString for ReferrerPolicy {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
impl Display for ReferrerPolicy {
|
||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let string = match self {
|
||||
ReferrerPolicy::NoReferrer => "no-referrer",
|
||||
ReferrerPolicy::NoReferrerWhenDowngrade => "no-referrer-when-downgrade",
|
||||
ReferrerPolicy::Origin => "origin",
|
||||
|
@ -129,8 +130,8 @@ impl ToString for ReferrerPolicy {
|
|||
ReferrerPolicy::UnsafeUrl => "unsafe-url",
|
||||
ReferrerPolicy::StrictOrigin => "strict-origin",
|
||||
ReferrerPolicy::StrictOriginWhenCrossOrigin => "strict-origin-when-cross-origin",
|
||||
}
|
||||
.to_string()
|
||||
};
|
||||
write!(formatter, "{string}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ unsafe impl Send for UntrustedNodeAddress {}
|
|||
|
||||
impl From<WebRenderUntrustedNodeAddress> for UntrustedNodeAddress {
|
||||
fn from(o: WebRenderUntrustedNodeAddress) -> Self {
|
||||
UntrustedNodeAddress(o.0 as *const c_void)
|
||||
UntrustedNodeAddress(o.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue