Derive PartialOrd, Ord, and Copy whenever possible (#717)

This allow other projects to use our structures inside others that need
those.
This commit is contained in:
Augusto Fotino 2022-11-30 14:25:59 -03:00 committed by GitHub
parent c429197340
commit 5e1d9f8d6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 106 additions and 106 deletions

View file

@ -36,7 +36,7 @@ use crate::dialect::{Dialect, MySqlDialect};
use crate::keywords::{Keyword, ALL_KEYWORDS, ALL_KEYWORDS_INDEX};
/// SQL Token enumeration
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Token {
/// An end-of-file marker, not a real token
@ -240,7 +240,7 @@ impl Token {
}
/// A keyword (like SELECT) or an optionally quoted SQL identifier
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Word {
/// The value of the token, without the enclosing quotes, and with the
@ -278,7 +278,7 @@ impl Word {
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Whitespace {
Space,