diff --git a/Cargo.toml b/Cargo.toml index 6334cb2e..d452083b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,17 +38,16 @@ features = ["run-for-all", "precommit-hook", "run-cargo-fmt", "run-cargo-test", [dependencies] chrono = "0.4" -failure = "0.1.6" -lazy_static = "1.4.0" -time = "0.2" +failure = "0.1" +lazy_static = "1.4" +time = "0.2.15" log = "0.4" uuid = { version = "0.8", features = ["v4", "serde"] } [dependencies.rusqlite] -version = "0.22.0" -# System sqlite might be very old. -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] [dependencies.edn] path = "edn" diff --git a/core-traits/Cargo.toml b/core-traits/Cargo.toml index 4151d410..aaecd4c9 100644 --- a/core-traits/Cargo.toml +++ b/core-traits/Cargo.toml @@ -10,8 +10,8 @@ path = "lib.rs" [dependencies] chrono = { version = "0.4", features = ["serde"] } enum-set = "0.0.8" -lazy_static = "1.4.0" -indexmap = "1.3.1" +lazy_static = "1.4" +indexmap = "1.3" ordered-float = { version = "1.0.2", features = ["serde"] } uuid = { version = "0.8", features = ["v4", "serde"] } serde = { version = "1.0", features = ["rc"] } diff --git a/db-traits/Cargo.toml b/db-traits/Cargo.toml index 6935cbda..927fd346 100644 --- a/db-traits/Cargo.toml +++ b/db-traits/Cargo.toml @@ -21,5 +21,5 @@ path = "../edn" path = "../core-traits" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] diff --git a/db/Cargo.toml b/db/Cargo.toml index 5ff63cc8..38f1841d 100644 --- a/db/Cargo.toml +++ b/db/Cargo.toml @@ -9,12 +9,12 @@ sqlcipher = ["rusqlite/sqlcipher"] syncable = ["serde", "serde_json", "serde_derive"] [dependencies] -failure = "0.1.6" -indexmap = "1.3.1" +failure = "0.1" +indexmap = "1.3" itertools = "0.9" -lazy_static = "1.4.0" +lazy_static = "1.4" log = "0.4" -ordered-float = "1.0.2" +ordered-float = "1.0" time = "0.2" petgraph = "0.5" serde = { version = "1.0", optional = true } @@ -22,8 +22,8 @@ serde_json = { version = "1.0", optional = true } serde_derive = { version = "1.0", optional = true } [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] [dependencies.edn] path = "../edn" diff --git a/db/src/cache.rs b/db/src/cache.rs index 59cca9f3..c5e67ee8 100644 --- a/db/src/cache.rs +++ b/db/src/cache.rs @@ -375,7 +375,7 @@ impl RemoveFromCache for MultiValAttributeCache { impl CardinalityManyCache for MultiValAttributeCache { fn acc(&mut self, e: Entid, v: TypedValue) { - self.e_vs.entry(e).or_insert_with(|| vec![]).push(v) + self.e_vs.entry(e).or_insert_with(Vec::new).push(v) } fn set(&mut self, e: Entid, vs: Vec) { diff --git a/db/src/metadata.rs b/db/src/metadata.rs index d9f88ed9..94e45e3b 100644 --- a/db/src/metadata.rs +++ b/db/src/metadata.rs @@ -111,7 +111,7 @@ fn update_attribute_map_from_schema_retractions( let mut eas = BTreeMap::new(); for (e, a, v) in retractions.into_iter() { if entids::is_a_schema_attribute(a) { - eas.entry(e).or_insert_with(|| vec![]).push(a); + eas.entry(e).or_insert_with(Vec::new).push(a); suspect_retractions.push((e, a, v)); } else { filtered_retractions.push((e, a, v)); diff --git a/db/src/upsert_resolution.rs b/db/src/upsert_resolution.rs index 2b44dd5e..03471b09 100644 --- a/db/src/upsert_resolution.rs +++ b/db/src/upsert_resolution.rs @@ -276,7 +276,7 @@ impl Generation { if attribute.unique == Some(attribute::Unique::Identity) { tempid_avs .entry((*a, Right(t2.clone()))) - .or_insert_with(|| vec![]) + .or_insert_with(Vec::new) .push(t1.clone()); } } @@ -286,7 +286,7 @@ impl Generation { if attribute.unique == Some(attribute::Unique::Identity) { tempid_avs .entry((*a, x.clone())) - .or_insert_with(|| vec![]) + .or_insert_with(Vec::new) .push(t.clone()); } } diff --git a/edn/src/query.rs b/edn/src/query.rs index d45f415b..aaf5c876 100644 --- a/edn/src/query.rs +++ b/edn/src/query.rs @@ -1030,8 +1030,8 @@ impl ParsedQuery { Ok(ParsedQuery { find_spec: find_spec.ok_or("expected :find")?, default_source: SrcVar::DefaultSrc, - with: with.unwrap_or_else(|| vec![]), - in_vars: in_vars.unwrap_or_else(|| vec![]), + with: with.unwrap_or_else(Vec::new), // + in_vars: in_vars.unwrap_or_else(Vec::new), in_sources: BTreeSet::default(), limit: limit.unwrap_or(Limit::None), where_clauses: where_clauses.ok_or("expected :where")?, diff --git a/public-traits/Cargo.toml b/public-traits/Cargo.toml index 266c8f54..8a1844fe 100644 --- a/public-traits/Cargo.toml +++ b/public-traits/Cargo.toml @@ -20,8 +20,8 @@ tokio-core = "0.1" uuid = "0.8" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] [dependencies.edn] path = "../edn" diff --git a/query-algebrizer/Cargo.toml b/query-algebrizer/Cargo.toml index 87d80952..6219cfd5 100644 --- a/query-algebrizer/Cargo.toml +++ b/query-algebrizer/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.1" workspace = ".." [dependencies] -failure = "0.1.1" +failure = "0.1" [dependencies.edn] path = "../edn" diff --git a/query-algebrizer/src/clauses/ground.rs b/query-algebrizer/src/clauses/ground.rs index b845dbdc..8bc73a24 100644 --- a/query-algebrizer/src/clauses/ground.rs +++ b/query-algebrizer/src/clauses/ground.rs @@ -129,7 +129,7 @@ impl ConjoiningClauses { if where_fn.binding.is_empty() { // The binding must introduce at least one bound variable. bail!(AlgebrizerError::InvalidBinding( - where_fn.operator.clone(), + where_fn.operator, BindingError::NoBoundVariable )); } @@ -137,7 +137,7 @@ impl ConjoiningClauses { if !where_fn.binding.is_valid() { // The binding must not duplicate bound variables. bail!(AlgebrizerError::InvalidBinding( - where_fn.operator.clone(), + where_fn.operator, BindingError::RepeatedBoundVariable )); } diff --git a/query-algebrizer/src/clauses/mod.rs b/query-algebrizer/src/clauses/mod.rs index e1546cde..187e7d8d 100644 --- a/query-algebrizer/src/clauses/mod.rs +++ b/query-algebrizer/src/clauses/mod.rs @@ -508,7 +508,7 @@ impl ConjoiningClauses { self.column_bindings .entry(var) - .or_insert_with(|| vec![]) + .or_insert_with(Vec::new) .push(alias); } diff --git a/query-algebrizer/src/clauses/or.rs b/query-algebrizer/src/clauses/or.rs index b3264fc0..9c91de00 100644 --- a/query-algebrizer/src/clauses/or.rs +++ b/query-algebrizer/src/clauses/or.rs @@ -727,7 +727,7 @@ fn union_types( for (var, new_types) in additional_types { match into.entry(var.clone()) { Entry::Vacant(e) => { - e.insert(new_types.clone()); + e.insert(*new_types); } Entry::Occupied(mut e) => { let new = e.get().union(*new_types); diff --git a/query-algebrizer/src/clauses/predicate.rs b/query-algebrizer/src/clauses/predicate.rs index 1d78870c..b1e7c6d6 100644 --- a/query-algebrizer/src/clauses/predicate.rs +++ b/query-algebrizer/src/clauses/predicate.rs @@ -98,7 +98,7 @@ impl ConjoiningClauses { .intersection(supported_types); if left_types.is_empty() { bail!(AlgebrizerError::InvalidArgumentType( - predicate.operator.clone(), + predicate.operator, supported_types, 0 )); @@ -109,7 +109,7 @@ impl ConjoiningClauses { .intersection(supported_types); if right_types.is_empty() { bail!(AlgebrizerError::InvalidArgumentType( - predicate.operator.clone(), + predicate.operator, supported_types, 1 )); @@ -161,7 +161,7 @@ impl ConjoiningClauses { right_v = self.resolve_ref_argument(known.schema, &predicate.operator, 1, right)?; } else { bail!(AlgebrizerError::InvalidArgumentType( - predicate.operator.clone(), + predicate.operator, supported_types, 0 )); diff --git a/query-projector-traits/Cargo.toml b/query-projector-traits/Cargo.toml index 9e76df6e..f5831be4 100644 --- a/query-projector-traits/Cargo.toml +++ b/query-projector-traits/Cargo.toml @@ -15,8 +15,8 @@ failure = "0.1" failure_derive = "0.1" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] [dependencies.edn] path = "../edn" diff --git a/query-projector/Cargo.toml b/query-projector/Cargo.toml index 87f875c7..b22b78c4 100644 --- a/query-projector/Cargo.toml +++ b/query-projector/Cargo.toml @@ -11,8 +11,8 @@ failure = "0.1" indexmap = "1.3" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] [dependencies.core_traits] path = "../core-traits" diff --git a/query-pull/Cargo.toml b/query-pull/Cargo.toml index 3a97e8ce..dc980059 100644 --- a/query-pull/Cargo.toml +++ b/query-pull/Cargo.toml @@ -7,14 +7,14 @@ workspace = ".." sqlcipher = ["rusqlite/sqlcipher"] [dependencies] -failure = "0.1.1" +failure = "0.1" [dependencies.query_pull_traits] path = "../query-pull-traits" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] [dependencies.edn] path = "../edn" diff --git a/query-sql/Cargo.toml b/query-sql/Cargo.toml index 4dbb73c8..5379e32a 100644 --- a/query-sql/Cargo.toml +++ b/query-sql/Cargo.toml @@ -3,8 +3,9 @@ name = "mentat_query_sql" version = "0.0.1" workspace = ".." -[dependencies] -rusqlite = "0.22" +[dependencies.rusqlite] +version = "0.23" +features = ["limits", "bundled"] [dependencies.edn] path = "../edn" diff --git a/sql/Cargo.toml b/sql/Cargo.toml index afb3cffe..8c100cfb 100644 --- a/sql/Cargo.toml +++ b/sql/Cargo.toml @@ -11,8 +11,8 @@ failure = "0.1" ordered-float = "1.0" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] [dependencies.core_traits] path = "../core-traits" diff --git a/tolstoy-traits/Cargo.toml b/tolstoy-traits/Cargo.toml index ac885593..b556844f 100644 --- a/tolstoy-traits/Cargo.toml +++ b/tolstoy-traits/Cargo.toml @@ -22,5 +22,5 @@ uuid = { version = "0.8" } path = "../db-traits" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] diff --git a/tolstoy/Cargo.toml b/tolstoy/Cargo.toml index 239a105e..83d5e503 100644 --- a/tolstoy/Cargo.toml +++ b/tolstoy/Cargo.toml @@ -51,5 +51,5 @@ path = "../public-traits" path = "../transaction" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] diff --git a/tools/cli/Cargo.toml b/tools/cli/Cargo.toml index 3cf6bfe9..daa2c9a8 100644 --- a/tools/cli/Cargo.toml +++ b/tools/cli/Cargo.toml @@ -34,8 +34,8 @@ termion = "1.5" time = "0.2" [dependencies.rusqlite] -version = "0.22" -features = ["limits"] +version = "0.23" +features = ["limits", "bundled"] [dependencies.mentat] path = "../.." diff --git a/transaction/Cargo.toml b/transaction/Cargo.toml index 403ff00b..be9a79f7 100644 --- a/transaction/Cargo.toml +++ b/transaction/Cargo.toml @@ -1,47 +1,47 @@ -[package] -name = "mentat_transaction" -version = "0.0.1" -workspace = ".." - -[features] -sqlcipher = ["rusqlite/sqlcipher"] - -[dependencies] -failure = "0.1" - -[dependencies.edn] -path = "../edn" - -[dependencies.public_traits] -path = "../public-traits" - -[dependencies.mentat_core] -path = "../core" - -[dependencies.core_traits] -path = "../core-traits" - -[dependencies.mentat_db] -path = "../db" - -[dependencies.db_traits] -path = "../db-traits" - -[dependencies.mentat_sql] -path = "../sql" - -[dependencies.mentat_query_algebrizer] -path = "../query-algebrizer" - -[dependencies.mentat_query_projector] -path = "../query-projector" - -[dependencies.mentat_query_pull] -path = "../query-pull" - -[dependencies.mentat_query_sql] -path = "../query-sql" - -[dependencies.rusqlite] -version = "0.22" -features = ["limits"] +[package] +name = "mentat_transaction" +version = "0.0.1" +workspace = ".." + +[features] +sqlcipher = ["rusqlite/sqlcipher"] + +[dependencies] +failure = "0.1" + +[dependencies.edn] +path = "../edn" + +[dependencies.public_traits] +path = "../public-traits" + +[dependencies.mentat_core] +path = "../core" + +[dependencies.core_traits] +path = "../core-traits" + +[dependencies.mentat_db] +path = "../db" + +[dependencies.db_traits] +path = "../db-traits" + +[dependencies.mentat_sql] +path = "../sql" + +[dependencies.mentat_query_algebrizer] +path = "../query-algebrizer" + +[dependencies.mentat_query_projector] +path = "../query-projector" + +[dependencies.mentat_query_pull] +path = "../query-pull" + +[dependencies.mentat_query_sql] +path = "../query-sql" + +[dependencies.rusqlite] +version = "0.23" +features = ["limits", "bundled"]