From 24d4036296893ba86e0dad3948721b5ed419ad72 Mon Sep 17 00:00:00 2001 From: John Giorshev Date: Mon, 28 Jul 2025 19:37:54 -0400 Subject: [PATCH] allow iter to transitive_reduce --- CHANGELOG.md | 4 ++++ Cargo.toml | 2 +- README.md | 6 +++--- src/lib.rs | 11 +++++++---- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e48e39..7f75db3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.10.0 (2025-07-28) + +* Backwards compatible edit to transitive_reduce (allow iter arg) + ## 0.9.0 (2025-04-18) * Update `petgraph` to `0.8` ([#43][#43]). diff --git a/Cargo.toml b/Cargo.toml index e8daea7..5ae0b94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daggy" -version = "0.9.0" +version = "0.10.0" authors = ["mitchmindtree "] description = "A directed acyclic graph data structure library. It is Implemented on top of petgraph's Graph data structure and attempts to follow similar conventions where suitable." readme = "README.md" diff --git a/README.md b/README.md index a27334d..9e47e14 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ Use daggy in your project by adding it to your `Cargo.toml` dependencies: ```toml [dependencies] -daggy = "0.9.0" +daggy = "0.10.0" # Enables the `StableDag` type. -daggy = { version = "0.9.0", features = ["stable_dag"] } +daggy = { version = "0.10.0", features = ["stable_dag"] } # Allows the `Dag` to be serialized and deserialized. -daggy = { version = "0.9.0", features = ["serde-1"] } +daggy = { version = "0.10.0", features = ["serde-1"] } ``` ## Examples diff --git a/src/lib.rs b/src/lib.rs index 521de91..fc898be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,13 +19,13 @@ //! //! ```toml //! [dependencies] -//! daggy = "0.9.0" +//! daggy = "0.10.0" //! //! # Enables the `StableDag` type. -//! daggy = { version = "0.9.0", features = ["stable_dag"] } +//! daggy = { version = "0.10.0", features = ["stable_dag"] } //! //! # Allows the `Dag` to be serialized and deserialized. -//! daggy = { version = "0.9.0", features = ["serde-1"] } +//! daggy = { version = "0.10.0", features = ["serde-1"] } //! ``` //! //! # Examples @@ -783,7 +783,10 @@ where } /// Mutates the DAG into its [transitive reduction](https://en.wikipedia.org/wiki/Directed_acyclic_graph#Transitive_closure_and_transitive_reduction) - pub fn transitive_reduce(&mut self, roots: Vec>) { + pub fn transitive_reduce(&mut self, roots: I) + where + I: IntoIterator>, + { for root in roots { self.transitive_reduce_iter(root, &mut Vec::new()) }