format: run rustfmt

This commit is contained in:
Austin Bonander 2020-07-27 22:18:39 -07:00 committed by Ryan Leckey
parent 5e452d9e86
commit 6b036055e5
No known key found for this signature in database
GPG key ID: F8AA68C235AB08C9
2 changed files with 16 additions and 6 deletions

View file

@ -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;

View file

@ -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));