This commit is contained in:
Gregory Burd 2023-11-24 17:35:42 +00:00
parent 290eb8e519
commit cdc3bc6bde
6 changed files with 9 additions and 7 deletions

View file

@ -1,5 +1,5 @@
[package] [package]
edition = "2018" edition = "2021"
authors = [ authors = [
"Richard Newman <rnewman@twinql.com>", "Richard Newman <rnewman@twinql.com>",
"Nicholas Alexander <nalexander@mozilla.com>", "Nicholas Alexander <nalexander@mozilla.com>",
@ -14,7 +14,7 @@ authors = [
"Gregory Burd <greg@burd.me>", "Gregory Burd <greg@burd.me>",
] ]
name = "mentat" name = "mentat"
version = "0.13.0" version = "0.14.0"
build = "build/version.rs" build = "build/version.rs"
[features] [features]

View file

@ -6,3 +6,5 @@ outdated:
fix: fix:
$(for p in $(dirname $(ls Cargo.toml */Cargo.toml */*/Cargo.toml)); do echo $p; (cd $p; cargo fix --allow-dirty --broken-code --edition-idioms); done) $(for p in $(dirname $(ls Cargo.toml */Cargo.toml */*/Cargo.toml)); do echo $p; (cd $p; cargo fix --allow-dirty --broken-code --edition-idioms); done)
upgrades:
cargo upgrades

View file

@ -14,7 +14,7 @@ use std::process::exit;
/// MIN_VERSION should be changed when there's a new minimum version of rustc required /// MIN_VERSION should be changed when there's a new minimum version of rustc required
/// to build the project. /// to build the project.
static MIN_VERSION: &str = "1.43.0"; static MIN_VERSION: &str = "1.69.0";
fn main() { fn main() {
let ver = version().unwrap(); let ver = version().unwrap();

View file

@ -1028,8 +1028,8 @@ impl ParsedQuery {
Ok(ParsedQuery { Ok(ParsedQuery {
find_spec: find_spec.ok_or("expected :find")?, find_spec: find_spec.ok_or("expected :find")?,
default_source: SrcVar::DefaultSrc, default_source: SrcVar::DefaultSrc,
with: with.unwrap_or_else(Vec::new), // with: with.unwrap_or_default(),
in_vars: in_vars.unwrap_or_else(Vec::new), in_vars: in_vars.unwrap_or_default(),
in_sources: BTreeSet::default(), in_sources: BTreeSet::default(),
limit: limit.unwrap_or(Limit::None), limit: limit.unwrap_or(Limit::None),
where_clauses: where_clauses.ok_or("expected :where")?, where_clauses: where_clauses.ok_or("expected :where")?,

View file

@ -690,7 +690,7 @@ pub trait FromMillis {
impl FromMillis for DateTime<Utc> { impl FromMillis for DateTime<Utc> {
fn from_millis(ts: i64) -> Self { fn from_millis(ts: i64) -> Self {
Utc.timestamp_opt(ts / 1_000, ((ts % 1_000).abs() as u32) * 1_000).unwrap() Utc.timestamp_opt(ts / 1_000, ((ts % 1_000).unsigned_abs() as u32) * 1_000).unwrap()
} }
} }

View file

@ -21,7 +21,7 @@ use crate::types::Value;
/// TODO: implement `merge` for [Value], following the `concat`/`SliceConcatExt` pattern. /// TODO: implement `merge` for [Value], following the `concat`/`SliceConcatExt` pattern.
pub fn merge(left: &Value, right: &Value) -> Option<Value> { pub fn merge(left: &Value, right: &Value) -> Option<Value> {
match (left, right) { match (left, right) {
(&Value::Map(ref l), &Value::Map(ref r)) => { (Value::Map(l), Value::Map(r)) => {
let mut result = l.clone(); let mut result = l.clone();
result.extend(r.clone()); result.extend(r.clone());
Some(Value::Map(result)) Some(Value::Map(result))