mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-19 21:50:19 +00:00
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:
parent
c429197340
commit
5e1d9f8d6e
10 changed files with 106 additions and 106 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue