mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -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}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue