Skip to content

Commit

Permalink
Fix badge in README (#24)
Browse files Browse the repository at this point in the history
* Fix badge in README

* Update library to use new array IntoIter impls

* Upgrade to petgraph 0.6 and criterion 0.4

* Bump version to v0.1.7
  • Loading branch information
ekzhang authored Jan 1, 2023
1 parent 5cf4c6e commit 43ec640
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crepe"
version = "0.1.6"
version = "0.1.7"
authors = ["Eric Zhang <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "Datalog in Rust as a procedural macro"
Expand Down Expand Up @@ -28,12 +28,12 @@ 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]
syn = { version = "1.0", features = ["full"] }
quote = "1.0"
proc-macro2 = "1.0"
proc-macro-error = "1.0"
petgraph = "0.5"
petgraph = "0.6"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[<img alt="github" src="https://img.shields.io/badge/github-ekzhang/crepe-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/ekzhang/crepe)
[<img alt="crates.io" src="https://img.shields.io/crates/v/crepe.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/crepe)
[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-crepe-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K" height="20">](https://docs.rs/crepe)
[<img alt="build status" src="https://img.shields.io/github/workflow/status/ekzhang/crepe/CI/main?style=for-the-badge" height="20">](https://github.com/ekzhang/crepe/actions?query=branch%3Amain)
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/ekzhang/crepe/ci.yml?style=for-the-badge" height="20">](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.
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion benches/collatz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<fnv::FnvBuildHasher>();
cols.len() - 1
Expand Down
2 changes: 1 addition & 1 deletion benches/fibonacci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<fnv::FnvBuildHasher>();
fibs.len()
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/// }
Expand Down
6 changes: 3 additions & 3 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?,
Expand Down Expand Up @@ -168,7 +168,7 @@ pub struct Fact {
impl Parse for Fact {
fn parse(input: ParseStream) -> Result<Self> {
let content;
#[allow(clippy::eval_order_dependence)]
#[allow(clippy::mixed_read_write_in_expression)]
Ok(Self {
negate: input.parse()?,
relation: input.parse()?,
Expand Down Expand Up @@ -198,7 +198,7 @@ pub struct For {

impl Parse for For {
fn parse(input: ParseStream) -> Result<Self> {
#[allow(clippy::eval_order_dependence)]
#[allow(clippy::mixed_read_write_in_expression)]
Ok(Self {
for_token: input.parse()?,
pat: input.parse()?,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_destructure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_disaggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/test_intermediate_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();
res.sort_unstable();
Expand Down
2 changes: 1 addition & 1 deletion tests/test_let_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ref_overwrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 43ec640

Please sign in to comment.