Skip to content

Commit

Permalink
Prep for 0.1.0 publish
Browse files Browse the repository at this point in the history
prep for 0.1.0 publish to crates.io + fix the example
  • Loading branch information
barrowsys committed Mar 2, 2021
1 parent 4fe9163 commit 1994475
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ version = "0.1.0"
authors = ["Ezra Barrow <[email protected]>"]
edition = "2018"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
description = "time-based state machine for daily scheduled state transitions"
repository = "https://github.com/barrowsys/timemachine"
categories = ["date-and-time", "data-structures"]

[dev-dependencies]
dialoguer = "0.7.1"
Expand Down
6 changes: 3 additions & 3 deletions examples/auto_lights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn handle_input(tm: &mut TimeMachine<State>) -> std::io::Result<(Time, Time, Tim
}
})
.interact_text()?;
let dusk2 = {
let dusk1 = {
let captures = time_re.captures(&dusk2).unwrap();
let mut hour: u8 = captures.get(1).unwrap().as_str().parse().unwrap();
let minute: u8 = captures.get(2).unwrap().as_str().parse().unwrap();
Expand All @@ -121,8 +121,8 @@ fn handle_input(tm: &mut TimeMachine<State>) -> std::io::Result<(Time, Time, Tim
.with_prompt("How many minutes after should the red light stay on?")
.default(60)
.interact_text()?;
let dusk1 = Time::from_seconds(
dusk2.as_seconds() - (dusk_length * 60) as u32
let dusk2 = Time::from_seconds(
dusk1.as_seconds() + (dusk_length * 60) as u32
);
Ok((dawn1, dawn2, dusk1, dusk2))
}

0 comments on commit 1994475

Please sign in to comment.