@@ -33,6 +33,7 @@ use core::{
33
33
fmt:: { self , Display } ,
34
34
hash,
35
35
} ;
36
+ use std:: cmp:: Ordering ;
36
37
37
38
#[ cfg( feature = "serde" ) ]
38
39
use serde:: { Deserialize , Serialize } ;
@@ -172,7 +173,7 @@ fn format_statement_list(f: &mut fmt::Formatter, statements: &[Statement]) -> fm
172
173
}
173
174
174
175
/// An identifier, decomposed into its value or character data and the quote style.
175
- #[ derive( Debug , Clone , PartialOrd , Ord ) ]
176
+ #[ derive( Debug , Clone ) ]
176
177
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
177
178
#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
178
179
pub struct Ident {
@@ -214,6 +215,34 @@ impl core::hash::Hash for Ident {
214
215
215
216
impl Eq for Ident { }
216
217
218
+ impl PartialOrd for Ident {
219
+ fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
220
+ Some ( self . cmp ( other) )
221
+ }
222
+ }
223
+
224
+ impl Ord for Ident {
225
+ fn cmp ( & self , other : & Self ) -> Ordering {
226
+ let Ident {
227
+ value,
228
+ quote_style,
229
+ // exhaustiveness check; we ignore spans in ordering
230
+ span : _,
231
+ } = self ;
232
+
233
+ let Ident {
234
+ value : other_value,
235
+ quote_style : other_quote_style,
236
+ // exhaustiveness check; we ignore spans in ordering
237
+ span : _,
238
+ } = other;
239
+
240
+ // First compare by value, then by quote_style
241
+ value. cmp ( other_value)
242
+ . then_with ( || quote_style. cmp ( other_quote_style) )
243
+ }
244
+ }
245
+
217
246
impl Ident {
218
247
/// Create a new identifier with the given value and no quotes and an empty span.
219
248
pub fn new < S > ( value : S ) -> Self
@@ -4181,7 +4210,7 @@ pub enum Statement {
4181
4210
/// ```sql
4182
4211
/// NOTIFY channel [ , payload ]
4183
4212
/// ```
4184
- /// send a notification event together with an optional “ payload” string to channel
4213
+ /// send a notification event together with an optional " payload" string to channel
4185
4214
///
4186
4215
/// See Postgres <https://www.postgresql.org/docs/current/sql-notify.html>
4187
4216
NOTIFY {
0 commit comments