Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-remind101 committed Sep 29, 2023
1 parent e66393c commit a6f051d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions sqlx-core/src/pool/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ impl<DB: Database> PoolInner<DB> {
// If no extra permits are available then we shouldn't be trying to spin up
// connections anyway.
let Some(permit) = self.semaphore.try_acquire(1) else {
return Ok(());
};
return Ok(());
};

// We must always obey `max_connections`.
let Some(guard) = self.try_increment_size(permit).ok() else {
return Ok(());
};
return Ok(());
};

// We skip `after_release` since the connection was never provided to user code
// besides `after_connect`, if they set it.
Expand Down
9 changes: 8 additions & 1 deletion sqlx-postgres/src/connection/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ impl PgConnection {

fn fetch_type_by_oid(&mut self, oid: Oid) -> BoxFuture<'_, Result<PgTypeInfo, Error>> {
Box::pin(async move {
let (name, typ_type, category, relation_id, element, base_type): (String, i8, i8, Oid, Oid, Oid) = query_as(
let (name, typ_type, category, relation_id, element, base_type): (
String,
i8,
i8,
Oid,
Oid,
Oid,
) = query_as(
r#"
SELECT nspname || '.' || typname, typtype, typcategory, typrelid, typelem, typbasetype
FROM pg_catalog.pg_type
Expand Down
5 changes: 1 addition & 4 deletions sqlx-postgres/src/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,10 +1154,7 @@ impl PartialEq<PgType> for PgType {
// Otherwise, perform a match on the name
// If either name has no schema qualification, match only on the name part.
// If both names have a schema qualification, match both the schema and name parts.
std::iter::zip(
self.name().rsplitn(2, '.'),
other.name().rsplitn(2, '.'),
)
std::iter::zip(self.name().rsplitn(2, '.'), other.name().rsplitn(2, '.'))
.all(|(part, other_part)| part.eq_ignore_ascii_case(other_part))
}
}
Expand Down

0 comments on commit a6f051d

Please sign in to comment.