Finite state machines in rust; bendns fork to add types.
Re-organize repository to import a single crate instead of two
Yevhenii Babichenko 2019-05-21
parent fb5f037 · commit 954ac15
-rw-r--r--CHANGELOG.md2
-rw-r--r--Cargo.toml21
-rw-r--r--README.md12
-rw-r--r--examples/circuit_breaker.rs (renamed from rust_fsm/examples/circuit_breaker.rs)0
-rw-r--r--examples/circuit_breaker_dsl.rs (renamed from rust_fsm/examples/circuit_breaker_dsl.rs)3
-rw-r--r--examples/simple.rs (renamed from rust_fsm/examples/simple.rs)3
-rw-r--r--rust_fsm/Cargo.toml18
-rw-r--r--src/lib.rs (renamed from rust_fsm/src/lib.rs)15
8 files changed, 27 insertions, 47 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 452a506..220b94b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog][keepachangelog], and this project
adheres to [Semantic Versioning][semver].
## [Unreleased]
+### Changed
+* Re-organize repository to import a single crate instead of two.
## [0.2.0] - 2019-05-16
### Added
diff --git a/Cargo.toml b/Cargo.toml
index 0107ec4..87446c4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,2 +1,21 @@
+[package]
+name = "rust-fsm"
+description = "A framework for building finite state machines in Rust"
+repository = "https://github.com/eugene-babichenko/rust-fsm"
+homepage = "https://github.com/eugene-babichenko/rust-fsm"
+readme = "../README.md"
+license = "MIT"
+categories = ["data-structures", "rust-patterns"]
+keywords = ["fsm"]
+version = "0.2.0"
+authors = ["Yevhenii Babichenko"]
+edition = "2018"
+
+[badges]
+travis-ci = { repository = "eugene-babichenko/rust-fsm" }
+
+[dependencies]
+rust-fsm-dsl = { path = "./rust_fsm_dsl", version = "0.2.0" }
+
[workspace]
-members = ["rust_fsm", "rust_fsm_dsl"]
+members = [".", "rust_fsm_dsl"]
diff --git a/README.md b/README.md
index e9e9971..c0741cc 100644
--- a/README.md
+++ b/README.md
@@ -3,14 +3,7 @@
[![Build Status][build-badge]][build-link]
The `rust-fsm` crate provides a simple and universal framework for building
-state machines in Rust with minimum effort. This is achieved by two
-components:
-
-* The `rust-fsm` crate, that provides data types for building state machines
- and convenience wrappers for these types.
-* The `rust-fsm-dsl` crate, that contains the `state_machine` macro that
- parses a simple DSL and generates all boilerplate code for the described
- state machine.
+state machines in Rust with minimum effort.
The essential part of this crate is the [`StateMachineImpl`] trait. This trait
allows a developer to provide a strict state machine definition, e.g.
@@ -48,9 +41,6 @@ macros system).
The DSL is parsed by the `state_machine` macro. Here is a little example.
```rust
-#[macro_use]
-extern crate rust_fsm_dsl;
-
use rust_fsm::*;
state_machine! {
diff --git a/rust_fsm/examples/circuit_breaker.rs b/examples/circuit_breaker.rs
index e0bcbbe..e0bcbbe 100644
--- a/rust_fsm/examples/circuit_breaker.rs
+++ b/examples/circuit_breaker.rs
diff --git a/rust_fsm/examples/circuit_breaker_dsl.rs b/examples/circuit_breaker_dsl.rs
index f1e81d5..1410416 100644
--- a/rust_fsm/examples/circuit_breaker_dsl.rs
+++ b/examples/circuit_breaker_dsl.rs
@@ -1,9 +1,6 @@
/// A dummy implementation of the Circuit Breaker pattern to demonstrate
/// capabilities of its library DSL for defining finite state machines.
/// https://martinfowler.com/bliki/CircuitBreaker.html
-#[macro_use]
-extern crate rust_fsm_dsl;
-
use rust_fsm::*;
use std::sync::{Arc, Mutex};
use std::time::Duration;
diff --git a/rust_fsm/examples/simple.rs b/examples/simple.rs
index 67b4fe1..81f8b98 100644
--- a/rust_fsm/examples/simple.rs
+++ b/examples/simple.rs
@@ -1,6 +1,3 @@
-#[macro_use]
-extern crate rust_fsm_dsl;
-
use rust_fsm::*;
state_machine! {
diff --git a/rust_fsm/Cargo.toml b/rust_fsm/Cargo.toml
deleted file mode 100644
index d581bbf..0000000
--- a/rust_fsm/Cargo.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-name = "rust-fsm"
-description = "A framework for building finite state machines in Rust"
-repository = "https://github.com/eugene-babichenko/rust-fsm"
-homepage = "https://github.com/eugene-babichenko/rust-fsm"
-readme = "../README.md"
-license = "MIT"
-categories = ["data-structures", "rust-patterns"]
-keywords = ["fsm"]
-version = "0.2.0"
-authors = ["Yevhenii Babichenko"]
-edition = "2018"
-
-[badges]
-travis-ci = { repository = "eugene-babichenko/rust-fsm" }
-
-[dev-dependencies]
-rust-fsm-dsl = { path = "../rust_fsm_dsl", version = "0.2.0" }
diff --git a/rust_fsm/src/lib.rs b/src/lib.rs
index ca863ef..fe08170 100644
--- a/rust_fsm/src/lib.rs
+++ b/src/lib.rs
@@ -1,14 +1,7 @@
//! A framework for building finite state machines in Rust
//!
//! The `rust-fsm` crate provides a simple and universal framework for building
-//! state machines in Rust with minimum effort. This is achieved by two
-//! components:
-//!
-//! * The `rust-fsm` crate, that provides data types for building state machines
-//! and convenience wrappers for these types.
-//! * The `rust-fsm-dsl` crate, that contains the `state_machine` macro that
-//! parses a simple DSL and generates all boilerplate code for the described
-//! state machine.
+//! state machines in Rust with minimum effort.
//!
//! The essential part of this crate is the [`StateMachineImpl`] trait. This
//! trait allows a developer to provide a strict state machine definition, e.g.
@@ -46,9 +39,6 @@
//! The DSL is parsed by the `state_machine` macro. Here is a little example.
//!
//! ```rust,ignore
-//! #[macro_use]
-//! extern crate rust_fsm_dsl;
-//!
//! use rust_fsm::*;
//!
//! state_machine! {
@@ -120,6 +110,9 @@
//!
//! [repo]: https://github.com/eugene-babichenko/rust-fsm/blob/master/examples/circuit_breaker.rs
+#[doc(hidden)]
+pub use rust_fsm_dsl::*;
+
/// This trait is designed to describe any possible deterministic finite state
/// machine/transducer. This is just a formal definition that may be
/// inconvenient to be used in practical programming, but it is used throughout