diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2022-09-19 10:25:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 10:25:03 +0200 |
commit | b1b418b81a13ede548273665e83c1bc5a97dffcd (patch) | |
tree | 731efb5a2811e1d925e94e9a8a16c220ac98de92 /runtime/permissions.rs | |
parent | a4a894fa1e933e8a678f8ad4f6353837859b02fd (diff) |
chore: fix clippy warnings (#15944)
Stop allowing clippy::derive-partial-eq-without-eq and fix warnings
about deriving PartialEq without also deriving Eq.
In one case I removed the PartialEq because it a) wasn't necessary,
and b) sketchy because it was comparing floating point numbers.
IMO, that's a good argument for enforcing the lint rule, because it
would most likely have been caught during review if it had been enabled.
Diffstat (limited to 'runtime/permissions.rs')
-rw-r--r-- | runtime/permissions.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/permissions.rs b/runtime/permissions.rs index 01143e7a6..2e8e3809f 100644 --- a/runtime/permissions.rs +++ b/runtime/permissions.rs @@ -34,7 +34,7 @@ static DEBUG_LOG_ENABLED: Lazy<bool> = Lazy::new(|| log::log_enabled!(log::Level::Debug)); /// Tri-state value for storing permission state -#[derive(PartialEq, Debug, Clone, Copy, Deserialize, PartialOrd)] +#[derive(Eq, PartialEq, Debug, Clone, Copy, Deserialize, PartialOrd)] pub enum PermissionState { Granted = 0, Prompt = 1, @@ -135,7 +135,7 @@ impl Default for PermissionState { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct UnitPermission { pub name: &'static str, pub description: &'static str, @@ -207,7 +207,7 @@ impl AsRef<str> for EnvVarName { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct UnaryPermission<T: Eq + Hash> { pub name: &'static str, pub description: &'static str, @@ -1133,7 +1133,7 @@ impl Default for UnaryPermission<FfiDescriptor> { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct Permissions { pub read: UnaryPermission<ReadDescriptor>, pub write: UnaryPermission<WriteDescriptor>, @@ -1158,7 +1158,7 @@ impl Default for Permissions { } } -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Default, Serialize, Deserialize)] pub struct PermissionsOptions { pub allow_env: Option<Vec<String>>, pub allow_hrtime: bool, @@ -1490,7 +1490,7 @@ fn escalation_error() -> AnyError { ) } -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub enum ChildUnitPermissionArg { Inherit, Granted, @@ -1542,7 +1542,7 @@ impl<'de> Deserialize<'de> for ChildUnitPermissionArg { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub enum ChildUnaryPermissionArg { Inherit, Granted, @@ -1610,7 +1610,7 @@ impl<'de> Deserialize<'de> for ChildUnaryPermissionArg { } /// Directly deserializable from JS worker and test permission options. -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub struct ChildPermissionsArg { env: ChildUnaryPermissionArg, hrtime: ChildUnitPermissionArg, |