mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
format: run rustfmt
This commit is contained in:
parent
5e452d9e86
commit
6b036055e5
2 changed files with 16 additions and 6 deletions
|
@ -302,9 +302,9 @@ fn parse_ident(name: &str) -> crate::Result<Ident> {
|
|||
// workaround for the following issue (it's semi-fixed but still spits out extra diagnostics)
|
||||
// https://github.com/dtolnay/syn/issues/749#issuecomment-575451318
|
||||
|
||||
let is_valid_ident = !name.is_empty() &&
|
||||
name.starts_with(|c: char| c.is_alphabetic() || c == '_') &&
|
||||
name.chars().all(|c| c.is_alphanumeric() || c == '_');
|
||||
let is_valid_ident = !name.is_empty()
|
||||
&& name.starts_with(|c: char| c.is_alphabetic() || c == '_')
|
||||
&& name.chars().all(|c| c.is_alphanumeric() || c == '_');
|
||||
|
||||
if is_valid_ident {
|
||||
let ident = String::from("r#") + name;
|
||||
|
|
|
@ -196,12 +196,18 @@ async fn it_describes_left_join() -> anyhow::Result<()> {
|
|||
assert_eq!(d.column(0).type_info().name(), "INTEGER");
|
||||
assert_eq!(d.nullable(0), Some(false));
|
||||
|
||||
let d = conn.describe("select tweet.id from accounts left join tweet on owner_id = accounts.id").await?;
|
||||
let d = conn
|
||||
.describe("select tweet.id from accounts left join tweet on owner_id = accounts.id")
|
||||
.await?;
|
||||
|
||||
assert_eq!(d.column(0).type_info().name(), "INTEGER");
|
||||
assert_eq!(d.nullable(0), Some(true));
|
||||
|
||||
let d = conn.describe("select tweet.id, accounts.id from accounts left join tweet on owner_id = accounts.id").await?;
|
||||
let d = conn
|
||||
.describe(
|
||||
"select tweet.id, accounts.id from accounts left join tweet on owner_id = accounts.id",
|
||||
)
|
||||
.await?;
|
||||
|
||||
assert_eq!(d.column(0).type_info().name(), "INTEGER");
|
||||
assert_eq!(d.nullable(0), Some(true));
|
||||
|
@ -209,7 +215,11 @@ async fn it_describes_left_join() -> anyhow::Result<()> {
|
|||
assert_eq!(d.column(1).type_info().name(), "INTEGER");
|
||||
assert_eq!(d.nullable(1), Some(false));
|
||||
|
||||
let d = conn.describe("select tweet.id, accounts.id from accounts inner join tweet on owner_id = accounts.id").await?;
|
||||
let d = conn
|
||||
.describe(
|
||||
"select tweet.id, accounts.id from accounts inner join tweet on owner_id = accounts.id",
|
||||
)
|
||||
.await?;
|
||||
|
||||
assert_eq!(d.column(0).type_info().name(), "INTEGER");
|
||||
assert_eq!(d.nullable(0), Some(false));
|
||||
|
|
Loading…
Reference in a new issue