Skip to content

Commit 1d09ff4

Browse files
committed
clippy
1 parent efc1e69 commit 1d09ff4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ For instance, if you want to rename all identifiers in a query:
5151
use sqlparser::{dialect::GenericDialect, parser::Parser, ast::Ident};
5252
use derive_visitor::{visitor_enter_fn_mut, DriveMut};
5353

54-
let mut statements = Parser::parse_sql(&GenericDialect, "select x").unwrap();
54+
let mut statements = Parser::parse_sql(&GenericDialect, "select xxx").unwrap();
5555
statements[0].drive_mut(&mut visitor_enter_fn_mut(|ident: &mut Ident| {
56-
ident.value = ident.value.replace("x", "y");
56+
ident.value = ident.value.replace("xxx", "yyy");
5757
}));
58-
assert_eq!(statements[0].to_string(), "SELECT y");
58+
assert_eq!(statements[0].to_string(), "SELECT yyy");
5959
```
6060

6161

tests/sqlparser_visitor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ mod test {
8484

8585
#[test]
8686
fn test_readme_example() {
87-
let mut statements = Parser::parse_sql(&GenericDialect, "select x").unwrap();
87+
let mut statements = Parser::parse_sql(&GenericDialect, "select xxx").unwrap();
8888
statements[0].drive_mut(&mut visitor_enter_fn_mut(|ident: &mut Ident| {
89-
ident.value = ident.value.replace("x", "y");
89+
ident.value = ident.value.replace("xxx", "yyy");
9090
}));
91-
assert_eq!(statements[0].to_string(), "SELECT y");
91+
assert_eq!(statements[0].to_string(), "SELECT yyy");
9292
}
9393
}

0 commit comments

Comments
 (0)