diff --git a/CHANGELOG.md b/CHANGELOG.md index e3e5819..47afc88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.1.7 - 2023-01-01 + +- Change library and examples to use Rust 2021 array `IntoIterator` impls +- Update petgraph dependency to v0.6 + ## 0.1.6 - 2022-02-22 - Implement support for iteration through `for` clauses in rules diff --git a/Cargo.toml b/Cargo.toml index a491aaf..6290317 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crepe" -version = "0.1.6" +version = "0.1.7" authors = ["Eric Zhang "] license = "MIT OR Apache-2.0" description = "Datalog in Rust as a procedural macro" @@ -28,7 +28,7 @@ harness = false [dev-dependencies] trybuild = "1.0.56" -criterion = { version = "0.3.5", features = ["html_reports"] } +criterion = { version = "0.4.0", features = ["html_reports"] } fnv = "1.0" [dependencies] @@ -36,4 +36,4 @@ syn = { version = "1.0", features = ["full"] } quote = "1.0" proc-macro2 = "1.0" proc-macro-error = "1.0" -petgraph = "0.5" +petgraph = "0.6" diff --git a/README.md b/README.md index e2a3026..95a8c1b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [github](https://github.com/ekzhang/crepe) [crates.io](https://crates.io/crates/crepe) [docs.rs](https://docs.rs/crepe) -[build status](https://github.com/ekzhang/crepe/actions?query=branch%3Amain) +[build status](https://github.com/ekzhang/crepe/actions?query=branch%3Amain) Crepe is a library that allows you to write declarative logic programs in Rust, with a [Datalog](https://en.wikipedia.org/wiki/Datalog)-like syntax. @@ -40,7 +40,7 @@ crepe! { fn main() { let mut runtime = Crepe::new(); - runtime.extend(&[Edge(1, 2), Edge(2, 3), Edge(3, 4), Edge(2, 5)]); + runtime.extend([Edge(1, 2), Edge(2, 3), Edge(3, 4), Edge(2, 5)]); let (reachable,) = runtime.run(); for Reachable(x, y) in reachable { diff --git a/benches/collatz.rs b/benches/collatz.rs index 0086b25..8090dcb 100644 --- a/benches/collatz.rs +++ b/benches/collatz.rs @@ -18,7 +18,7 @@ crepe! { fn collatz_length(n: u128) -> usize { let mut rt = Crepe::new(); - rt.extend(&[Start(n)]); + rt.extend([Start(n)]); let (cols,) = rt.run_with_hasher::(); cols.len() - 1 diff --git a/benches/fibonacci.rs b/benches/fibonacci.rs index 75e6e8c..a642fcc 100644 --- a/benches/fibonacci.rs +++ b/benches/fibonacci.rs @@ -21,7 +21,7 @@ crepe! { fn fibonacci_length(n: u128) -> usize { let mut rt = Crepe::new(); - rt.extend(&[Depth(n)]); + rt.extend([Depth(n)]); let (fibs,) = rt.run_with_hasher::(); fibs.len() diff --git a/src/lib.rs b/src/lib.rs index 0ac0c33..d3a2e26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -252,7 +252,7 @@ use strata::Strata; /// /// fn main() { /// let mut runtime = Crepe::new(); -/// runtime.extend(&[Word("banana"), Word("bandana")]); +/// runtime.extend([Word("banana"), Word("bandana")]); /// let (suffixes,) = runtime.run(); /// println!("{:?}", suffixes); /// } diff --git a/src/parse.rs b/src/parse.rs index 2b9e05f..ff3a4a7 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -79,7 +79,7 @@ impl Parse for Relation { None }; let content; - #[allow(clippy::eval_order_dependence)] + #[allow(clippy::mixed_read_write_in_expression)] Ok(Self { attribute, attrs: input.call(Attribute::parse_outer)?, @@ -168,7 +168,7 @@ pub struct Fact { impl Parse for Fact { fn parse(input: ParseStream) -> Result { let content; - #[allow(clippy::eval_order_dependence)] + #[allow(clippy::mixed_read_write_in_expression)] Ok(Self { negate: input.parse()?, relation: input.parse()?, @@ -198,7 +198,7 @@ pub struct For { impl Parse for For { fn parse(input: ParseStream) -> Result { - #[allow(clippy::eval_order_dependence)] + #[allow(clippy::mixed_read_write_in_expression)] Ok(Self { for_token: input.parse()?, pat: input.parse()?, diff --git a/tests/test_destructure.rs b/tests/test_destructure.rs index 3cd4044..c076b5d 100644 --- a/tests/test_destructure.rs +++ b/tests/test_destructure.rs @@ -37,7 +37,7 @@ crepe! { #[test] fn test_destructure() { let mut runtime = Crepe::new(); - runtime.extend(&[ + runtime.extend([ ProgramToken(Token::String("hello")), ProgramToken(Token::String("world")), ProgramToken(Token::Integer(42)), diff --git a/tests/test_disaggregate.rs b/tests/test_disaggregate.rs index ec6e0fc..1e23a62 100644 --- a/tests/test_disaggregate.rs +++ b/tests/test_disaggregate.rs @@ -16,7 +16,7 @@ crepe! { #[test] fn test_disaggregate() { let mut rt = Crepe::new(); - rt.extend(&[Name("al"), Name("bob")]); + rt.extend([Name("al"), Name("bob")]); let (res,) = rt.run(); let mut res: Vec<_> = res.into_iter().collect(); res.sort(); diff --git a/tests/test_intermediate_lifetime.rs b/tests/test_intermediate_lifetime.rs index 18a1f61..d66eb32 100644 --- a/tests/test_intermediate_lifetime.rs +++ b/tests/test_intermediate_lifetime.rs @@ -22,7 +22,7 @@ crepe! { #[test] fn test_intermediate_lifetime() { let mut rt = Crepe::new(); - rt.extend(&[Input([0, 1, 2, 3]), Input([1, 2, 3, 4])]); + rt.extend([Input([0, 1, 2, 3]), Input([1, 2, 3, 4])]); let (res,) = rt.run(); let mut res = res.into_iter().map(|Output(n)| n).collect::>(); res.sort_unstable(); diff --git a/tests/test_let_bindings.rs b/tests/test_let_bindings.rs index 090b057..e1baee8 100644 --- a/tests/test_let_bindings.rs +++ b/tests/test_let_bindings.rs @@ -36,7 +36,7 @@ crepe! { #[test] fn test_let_bindings() { let mut rt = Crepe::new(); - rt.extend(&[Input(2), Input(3), Input(4)]); + rt.extend([Input(2), Input(3), Input(4)]); let (res,) = rt.run(); let res: Vec<_> = res.into_iter().collect(); assert_eq!(res, vec![Output(2)]); diff --git a/tests/test_ref_overwrite.rs b/tests/test_ref_overwrite.rs index 13049bb..09b8f84 100644 --- a/tests/test_ref_overwrite.rs +++ b/tests/test_ref_overwrite.rs @@ -19,7 +19,7 @@ crepe! { #[test] fn test_ref_overwrite() { let mut rt = Crepe::new(); - rt.extend(&[Input(2), Input(3)]); + rt.extend([Input(2), Input(3)]); let (res,) = rt.run(); let mut res: Vec<_> = res.into_iter().collect(); res.sort_unstable();