diff --git a/Cargo.lock b/Cargo.lock index b1cdddedfb..a3208084c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3031,6 +3031,9 @@ name = "smallvec" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +dependencies = [ + "serde", +] [[package]] name = "socket2" diff --git a/sqlx-postgres/Cargo.toml b/sqlx-postgres/Cargo.toml index 0fd05720c5..b157445e39 100644 --- a/sqlx-postgres/Cargo.toml +++ b/sqlx-postgres/Cargo.toml @@ -58,7 +58,7 @@ log = "0.4.17" memchr = { version = "2.4.1", default-features = false } num-bigint = { version = "0.4.3", optional = true } once_cell = "1.9.0" -smallvec = "1.7.0" +smallvec = { version = "1.7.0", features = ["serde"] } stringprep = "0.1.2" thiserror = "1.0.35" tracing = { version = "0.1.37", features = ["log"] } diff --git a/sqlx-postgres/src/connection/describe.rs b/sqlx-postgres/src/connection/describe.rs index 8a5d1a23db..189ae3389b 100644 --- a/sqlx-postgres/src/connection/describe.rs +++ b/sqlx-postgres/src/connection/describe.rs @@ -10,6 +10,7 @@ use crate::types::Oid; use crate::HashMap; use crate::{PgArguments, PgColumn, PgConnection, PgTypeInfo}; use futures_core::future::BoxFuture; +use smallvec::SmallVec; use std::fmt::Write; use std::sync::Arc; @@ -447,7 +448,8 @@ WHERE rngtypid = $1 explain += ")"; } - let (Json(explains),): (Json>,) = query_as(&explain).fetch_one(self).await?; + let (Json(explains),): (Json>,) = + query_as(&explain).fetch_one(self).await?; let mut nullables = Vec::new(); @@ -460,7 +462,7 @@ WHERE rngtypid = $1 }) = explains.first() { nullables.resize(outputs.len(), None); - visit_plan(plan, outputs, &mut nullables); + visit_plan(&plan, outputs, &mut nullables); } Ok(nullables)