Skip to content

Commit

Permalink
Merge pull request #223 from Virgiel/dependencies
Browse files Browse the repository at this point in the history
Update dependencies and especially deadpool
  • Loading branch information
LouisGariepy authored Oct 20, 2023
2 parents 5098729 + cf32042 commit 22df44e
Show file tree
Hide file tree
Showing 12 changed files with 602 additions and 568 deletions.
1,143 changes: 588 additions & 555 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"examples/*",
"test_integration",
Expand Down
2 changes: 1 addition & 1 deletion benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cornucopia_sync = { path = "../crates/client_sync" }
cornucopia_async = { path = "../crates/client_async" }

# benchmarking
criterion = { version = "0.4.0", features = ["html_reports"] }
criterion = { version = "0.5.1", features = ["html_reports"] }

# async
tokio = { version = "1.24.2", features = ["full"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/client_async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ async-trait = "0.1.63"
tokio-postgres = "0.7.7"

# connection pooling
deadpool-postgres = { version = "0.10.4", optional = true }
deadpool-postgres = { version = "0.11.0", optional = true }
2 changes: 1 addition & 1 deletion crates/client_core/src/array_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl<'a, T: FromSql<'a>> FromSql<'a> for ArrayIterator<'a, T> {
Ok(ArrayIterator {
ty: member_type.clone(),
values: array.values(),
_type: PhantomData::default(),
_type: PhantomData,
})
}

Expand Down
2 changes: 1 addition & 1 deletion crates/cornucopia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ clap = { version = "4.1.1", features = ["derive"] }
heck = "0.4.0"

# Order-preserving map to work around borrowing issues
indexmap = "1.9.2"
indexmap = "2.0.2"
4 changes: 2 additions & 2 deletions crates/cornucopia/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ fn gen_params_struct(w: &mut impl Write, params: &PreparedItem, ctx: &GenCtx) {
.map(|p| p.param_ergo_ty(traits, ctx))
.collect::<Vec<_>>();
let fields_name = fields.iter().map(|p| &p.ident.rs);
let traits_idx = (1..=traits.len()).into_iter().map(idx_char);
let traits_idx = (1..=traits.len()).map(idx_char);
code!(w =>
#[derive($copy Debug)]
pub struct $name<$lifetime $($traits_idx: $traits,)> {
Expand Down Expand Up @@ -507,7 +507,7 @@ fn gen_query_fn<W: Write>(w: &mut W, module: &PreparedModule, query: &PreparedQu
.map(|idx| param_field[*idx].param_ergo_ty(traits, ctx))
.collect();
let params_name = order.iter().map(|idx| &param_field[*idx].ident.rs);
let traits_idx = (1..=traits.len()).into_iter().map(idx_char);
let traits_idx = (1..=traits.len()).map(idx_char);
let lazy_impl = |w: &mut W| {
if let Some((idx, index)) = row {
let item = module.rows.get_index(*idx).unwrap().1;
Expand Down
3 changes: 2 additions & 1 deletion crates/cornucopia/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ impl Query {
.iter()
.enumerate()
.rev()
.filter_map(|(i, u)| (!bind_params[..i].contains(u)).then(|| u.clone()))
.filter(|(i, u)| !bind_params[..*i].contains(u))
.map(|(_, u)| u.clone())
.rev()
.collect();

Expand Down
2 changes: 1 addition & 1 deletion examples/auto_build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ futures = "0.3.25"
tokio-postgres = "0.7.7"
postgres-types = "0.2.4"
## Connection pooling
deadpool-postgres = "0.10.4"
deadpool-postgres = "0.11.0"

[build-dependencies]
# Cornucopia library to automatically
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ futures = "0.3.25"
tokio-postgres = "0.7.7"
postgres-types = { version = "0.2.4", features = ["derive"] }
## Connection pooling
deadpool-postgres = "0.10.4"
deadpool-postgres = "0.11.0"
5 changes: 2 additions & 3 deletions test_codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ pub fn test_trait_sql(client: &mut Client) {
.unwrap();
find_books().bind(client, &vec![cow]).all().unwrap();

let map: HashMap<&str, &str> =
HashMap::from_iter([("one", "1"), ("two", "2"), ("three", "3")].into_iter());
let map: HashMap<&str, &str> = HashMap::from_iter([("one", "1"), ("two", "2"), ("three", "3")]);

// Old way with allocation
let vec: Vec<_> = map.values().collect();
Expand Down Expand Up @@ -299,7 +298,7 @@ pub fn test_named(client: &mut Client) {
}

// Test we correctly implement borrowed version and copy derive
#[allow(clippy::drop_copy)]
#[allow(dropping_copy_types)]
pub fn test_copy(client: &mut Client) {
// Test copy
let copy_params = CopyComposite {
Expand Down
2 changes: 1 addition & 1 deletion test_integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ postgres = { version = "0.19.4" }
## Test fixtures ser/de
serde = { version = "1.0.148", features = ["derive"] }
## Read/write fixture files
toml = "0.7.2"
toml = "0.8.2"

0 comments on commit 22df44e

Please sign in to comment.