File tree 9 files changed +38
-30
lines changed
9 files changed +38
-30
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ impl fmt::Display for ColumnOption {
254
254
}
255
255
}
256
256
257
- fn display_constraint_name < ' a > ( name : & ' a Option < Ident > ) -> impl fmt:: Display + ' a {
257
+ fn display_constraint_name ( name : & ' _ Option < Ident > ) -> impl fmt:: Display + ' _ {
258
258
struct ConstraintName < ' a > ( & ' a Option < Ident > ) ;
259
259
impl < ' a > fmt:: Display for ConstraintName < ' a > {
260
260
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
Original file line number Diff line number Diff line change @@ -346,7 +346,7 @@ impl fmt::Display for Join {
346
346
_ => "" ,
347
347
}
348
348
}
349
- fn suffix < ' a > ( constraint : & ' a JoinConstraint ) -> impl fmt:: Display + ' a {
349
+ fn suffix ( constraint : & ' _ JoinConstraint ) -> impl fmt:: Display + ' _ {
350
350
struct Suffix < ' a > ( & ' a JoinConstraint ) ;
351
351
impl < ' a > fmt:: Display for Suffix < ' a > {
352
352
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ pub struct AnsiDialect {}
17
17
18
18
impl Dialect for AnsiDialect {
19
19
fn is_identifier_start ( & self , ch : char ) -> bool {
20
- ( ch >= 'a' && ch <= 'z' ) || ( ch >= 'A' && ch <= 'Z' )
20
+ ( 'a' ..= 'z' ) . contains ( & ch ) || ( 'A' ..= 'Z' ) . contains ( & ch )
21
21
}
22
22
23
23
fn is_identifier_part ( & self , ch : char ) -> bool {
24
- ( ch >= 'a' && ch <= 'z' )
25
- || ( ch >= 'A' && ch <= 'Z' )
26
- || ( ch >= '0' && ch <= '9' )
24
+ ( 'a' ..= 'z' ) . contains ( & ch )
25
+ || ( 'A' ..= 'Z' ) . contains ( & ch )
26
+ || ( '0' ..= '9' ) . contains ( & ch )
27
27
|| ch == '_'
28
28
}
29
29
}
Original file line number Diff line number Diff line change @@ -17,13 +17,17 @@ pub struct GenericDialect;
17
17
18
18
impl Dialect for GenericDialect {
19
19
fn is_identifier_start ( & self , ch : char ) -> bool {
20
- ( ch >= 'a' && ch <= 'z' ) || ( ch >= 'A' && ch <= 'Z' ) || ch == '_' || ch == '#' || ch == '@'
20
+ ( 'a' ..='z' ) . contains ( & ch)
21
+ || ( 'A' ..='Z' ) . contains ( & ch)
22
+ || ch == '_'
23
+ || ch == '#'
24
+ || ch == '@'
21
25
}
22
26
23
27
fn is_identifier_part ( & self , ch : char ) -> bool {
24
- ( ch >= 'a' && ch <= 'z' )
25
- || ( ch >= 'A' && ch <= 'Z' )
26
- || ( ch >= '0' && ch <= '9' )
28
+ ( 'a' ..= 'z' ) . contains ( & ch )
29
+ || ( 'A' ..= 'Z' ) . contains ( & ch )
30
+ || ( '0' ..= '9' ) . contains ( & ch )
27
31
|| ch == '@'
28
32
|| ch == '$'
29
33
|| ch == '#'
Original file line number Diff line number Diff line change @@ -23,13 +23,17 @@ impl Dialect for MsSqlDialect {
23
23
fn is_identifier_start ( & self , ch : char ) -> bool {
24
24
// See https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers?view=sql-server-2017#rules-for-regular-identifiers
25
25
// We don't support non-latin "letters" currently.
26
- ( ch >= 'a' && ch <= 'z' ) || ( ch >= 'A' && ch <= 'Z' ) || ch == '_' || ch == '#' || ch == '@'
26
+ ( 'a' ..='z' ) . contains ( & ch)
27
+ || ( 'A' ..='Z' ) . contains ( & ch)
28
+ || ch == '_'
29
+ || ch == '#'
30
+ || ch == '@'
27
31
}
28
32
29
33
fn is_identifier_part ( & self , ch : char ) -> bool {
30
- ( ch >= 'a' && ch <= 'z' )
31
- || ( ch >= 'A' && ch <= 'Z' )
32
- || ( ch >= '0' && ch <= '9' )
34
+ ( 'a' ..= 'z' ) . contains ( & ch )
35
+ || ( 'A' ..= 'Z' ) . contains ( & ch )
36
+ || ( '0' ..= '9' ) . contains ( & ch )
33
37
|| ch == '@'
34
38
|| ch == '$'
35
39
|| ch == '#'
Original file line number Diff line number Diff line change @@ -20,15 +20,15 @@ impl Dialect for MySqlDialect {
20
20
// See https://dev.mysql.com/doc/refman/8.0/en/identifiers.html.
21
21
// We don't yet support identifiers beginning with numbers, as that
22
22
// makes it hard to distinguish numeric literals.
23
- ( ch >= 'a' && ch <= 'z' )
24
- || ( ch >= 'A' && ch <= 'Z' )
23
+ ( 'a' ..= 'z' ) . contains ( & ch )
24
+ || ( 'A' ..= 'Z' ) . contains ( & ch )
25
25
|| ch == '_'
26
26
|| ch == '$'
27
- || ( ch >= '\u{0080}' && ch <= '\u{ffff}' )
27
+ || ( '\u{0080}' ..= '\u{ffff}' ) . contains ( & ch )
28
28
}
29
29
30
30
fn is_identifier_part ( & self , ch : char ) -> bool {
31
- self . is_identifier_start ( ch) || ( ch >= '0' && ch <= '9' )
31
+ self . is_identifier_start ( ch) || ( '0' ..= '9' ) . contains ( & ch )
32
32
}
33
33
34
34
fn is_delimited_identifier_start ( & self , ch : char ) -> bool {
Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ impl Dialect for PostgreSqlDialect {
20
20
// See https://www.postgresql.org/docs/11/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
21
21
// We don't yet support identifiers beginning with "letters with
22
22
// diacritical marks and non-Latin letters"
23
- ( ch >= 'a' && ch <= 'z' ) || ( ch >= 'A' && ch <= 'Z' ) || ch == '_'
23
+ ( 'a' ..= 'z' ) . contains ( & ch ) || ( 'A' ..= 'Z' ) . contains ( & ch ) || ch == '_'
24
24
}
25
25
26
26
fn is_identifier_part ( & self , ch : char ) -> bool {
27
- ( ch >= 'a' && ch <= 'z' )
28
- || ( ch >= 'A' && ch <= 'Z' )
29
- || ( ch >= '0' && ch <= '9' )
27
+ ( 'a' ..= 'z' ) . contains ( & ch )
28
+ || ( 'A' ..= 'Z' ) . contains ( & ch )
29
+ || ( '0' ..= '9' ) . contains ( & ch )
30
30
|| ch == '$'
31
31
|| ch == '_'
32
32
}
Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ pub struct SnowflakeDialect;
18
18
impl Dialect for SnowflakeDialect {
19
19
// see https://docs.snowflake.com/en/sql-reference/identifiers-syntax.html
20
20
fn is_identifier_start ( & self , ch : char ) -> bool {
21
- ( ch >= 'a' && ch <= 'z' ) || ( ch >= 'A' && ch <= 'Z' ) || ch == '_'
21
+ ( 'a' ..= 'z' ) . contains ( & ch ) || ( 'A' ..= 'Z' ) . contains ( & ch ) || ch == '_'
22
22
}
23
23
24
24
fn is_identifier_part ( & self , ch : char ) -> bool {
25
- ( ch >= 'a' && ch <= 'z' )
26
- || ( ch >= 'A' && ch <= 'Z' )
27
- || ( ch >= '0' && ch <= '9' )
25
+ ( 'a' ..= 'z' ) . contains ( & ch )
26
+ || ( 'A' ..= 'Z' ) . contains ( & ch )
27
+ || ( '0' ..= '9' ) . contains ( & ch )
28
28
|| ch == '$'
29
29
|| ch == '_'
30
30
}
Original file line number Diff line number Diff line change @@ -25,14 +25,14 @@ impl Dialect for SQLiteDialect {
25
25
26
26
fn is_identifier_start ( & self , ch : char ) -> bool {
27
27
// See https://www.sqlite.org/draft/tokenreq.html
28
- ( ch >= 'a' && ch <= 'z' )
29
- || ( ch >= 'A' && ch <= 'Z' )
28
+ ( 'a' ..= 'z' ) . contains ( & ch )
29
+ || ( 'A' ..= 'Z' ) . contains ( & ch )
30
30
|| ch == '_'
31
31
|| ch == '$'
32
- || ( ch >= '\u{007f}' && ch <= '\u{ffff}' )
32
+ || ( '\u{007f}' ..= '\u{ffff}' ) . contains ( & ch )
33
33
}
34
34
35
35
fn is_identifier_part ( & self , ch : char ) -> bool {
36
- self . is_identifier_start ( ch) || ( ch >= '0' && ch <= '9' )
36
+ self . is_identifier_start ( ch) || ( '0' ..= '9' ) . contains ( & ch )
37
37
}
38
38
}
You can’t perform that action at this time.
0 commit comments