Skip to content

Commit

Permalink
refactor: remove unnecessary string hashes (#815)
Browse files Browse the repository at this point in the history
* refactor: remove unnecessary string hashes

* fix: formatting in `src/types.rs`

* refactor: restore `#` for consistent formatting

in specific spots

* refactor: restore stylistic changes in `table.rs`
  • Loading branch information
hamirmahal authored Nov 28, 2024
1 parent ff8f58a commit ea1d9fa
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 104 deletions.
10 changes: 5 additions & 5 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ mod tests {

#[test]
fn test_9() {
let string = r#"[ab] "#;
let string = r"[ab] ";
let tokenizer = Tokenizer::new(string);
let tokens: Vec<Token> = tokenizer.iter().collect();
assert_eq!(
Expand Down Expand Up @@ -491,7 +491,7 @@ mod tests {

#[test]
fn test_11() {
let string = r#" `a``b` "#;
let string = r" `a``b` ";
let tokenizer = Tokenizer::new(string);
let tokens: Vec<Token> = tokenizer.iter().collect();
assert_eq!(
Expand All @@ -510,7 +510,7 @@ mod tests {

#[test]
fn test_12() {
let string = r#" 'a''b' "#;
let string = r" 'a''b' ";
let tokenizer = Tokenizer::new(string);
let tokens: Vec<Token> = tokenizer.iter().collect();
assert_eq!(
Expand All @@ -529,7 +529,7 @@ mod tests {

#[test]
fn test_13() {
let string = r#"(?)"#;
let string = r"(?)";
let tokenizer = Tokenizer::new(string);
let tokens: Vec<Token> = tokenizer.iter().collect();
assert_eq!(
Expand All @@ -548,7 +548,7 @@ mod tests {

#[test]
fn test_14() {
let string = r#"($1 = $2)"#;
let string = r"($1 = $2)";
let tokenizer = Tokenizer::new(string);
let tokens: Vec<Token> = tokenizer.iter().collect();
assert_eq!(
Expand Down
9 changes: 3 additions & 6 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,10 +623,7 @@ mod tests {
.to_owned();

#[cfg(feature = "backend-mysql")]
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `hello-World_`"#
);
assert_eq!(query.to_string(MysqlQueryBuilder), r"SELECT `hello-World_`");
#[cfg(feature = "backend-postgres")]
assert_eq!(
query.to_string(PostgresQueryBuilder),
Expand All @@ -644,7 +641,7 @@ mod tests {
let query = Query::select().column(Alias::new("hel`lo")).to_owned();

#[cfg(feature = "backend-mysql")]
assert_eq!(query.to_string(MysqlQueryBuilder), r#"SELECT `hel``lo`"#);
assert_eq!(query.to_string(MysqlQueryBuilder), r"SELECT `hel``lo`");
#[cfg(feature = "backend-sqlite")]
assert_eq!(query.to_string(SqliteQueryBuilder), r#"SELECT "hel`lo""#);

Expand All @@ -659,7 +656,7 @@ mod tests {
let query = Query::select().column(Alias::new("hel``lo")).to_owned();

#[cfg(feature = "backend-mysql")]
assert_eq!(query.to_string(MysqlQueryBuilder), r#"SELECT `hel````lo`"#);
assert_eq!(query.to_string(MysqlQueryBuilder), r"SELECT `hel````lo`");
#[cfg(feature = "backend-sqlite")]
assert_eq!(query.to_string(SqliteQueryBuilder), r#"SELECT "hel``lo""#);

Expand Down
Loading

0 comments on commit ea1d9fa

Please sign in to comment.