Upgrade Rust code deprecation warnings

This commit is contained in:
Tobie Morgan Hitchcock 2023-03-18 09:18:22 +00:00
parent f48de42695
commit 42725789a0
4 changed files with 7 additions and 22 deletions

View file

@ -9,9 +9,10 @@ pub enum Level {
}
/// Specifies the current authentication for the datastore execution context.
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd)]
pub enum Auth {
/// Specifies that the user is not authenticated
#[default]
No,
/// Specifies that the user is authenticated with full root permissions
Kv,
@ -23,12 +24,6 @@ pub enum Auth {
Sc(String, String, String),
}
impl Default for Auth {
fn default() -> Self {
Auth::No
}
}
impl Auth {
/// Checks whether the current authentication has root level permissions
pub fn is_kv(&self) -> bool {

View file

@ -1,4 +1,4 @@
#![allow(clippy::derive_hash_xor_eq)]
#![allow(clippy::derived_hash_with_manual_eq)]
use crate::sql::comment::mightbespace;
use crate::sql::common::commas;

View file

@ -9,21 +9,16 @@ pub struct Operation {
pub value: Value,
}
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
pub enum Op {
None,
#[default]
Add,
Remove,
Replace,
Change,
}
impl Default for Op {
fn default() -> Op {
Op::Add
}
}
impl From<&Value> for Op {
fn from(v: &Value) -> Self {
match v.to_strand().as_str() {

View file

@ -96,8 +96,9 @@ pub fn whats(i: &str) -> IResult<&str, Values> {
Ok((i, Values(v)))
}
#[derive(Clone, Debug, PartialEq, PartialOrd, Deserialize, Store, Hash)]
#[derive(Clone, Debug, Default, PartialEq, PartialOrd, Deserialize, Store, Hash)]
pub enum Value {
#[default]
None,
Null,
False,
@ -135,12 +136,6 @@ impl Ord for Value {
}
}
impl Default for Value {
fn default() -> Value {
Value::None
}
}
impl From<bool> for Value {
#[inline]
fn from(v: bool) -> Self {