Skip to content

Commit

Permalink
Rename 'localtime' to 'local-time' (cargo feature)…
Browse files Browse the repository at this point in the history
…to be similar to the corresponding feature in the `time` crate.
  • Loading branch information
Byron committed Aug 31, 2021
1 parent 72ea8a9 commit b6ee809
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## v16.0.0

### Improvements

- Use `time` version 0.3 when the `local-time` feature is enabled

### Breaking

- rename cargo feature `localtime` to `local-time`

## v15.0.1

* crosstermion is optional for some renderers (again)
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ doctest = true
[[example]]
name = "dashboard"
path = "examples/dashboard.rs"
required-features = ["render-tui", "render-tui-crossterm", "render-line", "render-line-crossterm", "signal-hook", "render-line-autoconfigure"]
required-features = ["render-tui", "render-tui-crossterm", "render-line", "render-line-crossterm", "signal-hook", "render-line-autoconfigure", "progress-tree"]

[[example]]
name = "dashboard-termion"
path = "examples/dashboard.rs"
required-features = ["render-tui", "render-tui-termion", "render-line", "render-line-termion"]
required-features = ["render-tui", "render-tui-termion", "render-line", "render-line-termion", "progress-tree"]

[[example]]
name = "units"
Expand All @@ -37,7 +37,7 @@ required-features = [
]

[features]
default = ["progress-tree", "progress-tree-log", "localtime"]
default = ["progress-tree", "progress-tree-log", "local-time"]
progress-tree = ["dashmap", "parking_lot"]
progress-tree-log = ["log"]
progress-log = ["log"]
Expand All @@ -60,7 +60,7 @@ render-line-crossterm = ["crosstermion/crossterm"]
render-line-termion = ["crosstermion/termion"]
render-line-autoconfigure = ["atty"]

localtime = ["time"]
local-time = ["time"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This crate comes with various cargo features to tailor it to your needs.
* May interfere with `render-tui` or `render-line`, or any renderer outputting to the console.
* **progress-log**
* A `Progress` implementation which logs messages and progress using the `log` crate
* **localtime** _(default)_
* **local-time** _(default)_
* If set, timestamps in the message pane of the `render-tui` will be using the local time, not UTC
* If set, timestamps of the log messages of the `render-line` will be using the local time, not UTC
* Has no effect without the `render-tui` or `render-line` respectively
Expand Down
8 changes: 4 additions & 4 deletions src/time.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(feature = "localtime")]
#[cfg(feature = "local-time")]
mod localtime {
use std::time::SystemTime;

Expand All @@ -24,7 +24,7 @@ mod localtime {
/// An `hours:minute:seconds` format.
pub const DATE_TIME_HMS: usize = "00:51:45".len();

#[cfg(not(feature = "localtime"))]
#[cfg(not(feature = "local-time"))]
mod utc {
use super::DATE_TIME_HMS;
use std::time::SystemTime;
Expand Down Expand Up @@ -54,8 +54,8 @@ mod utc {
}
}

#[cfg(feature = "localtime")]
#[cfg(feature = "local-time")]
pub use localtime::*;

#[cfg(not(feature = "localtime"))]
#[cfg(not(feature = "local-time"))]
pub use utc::*;

0 comments on commit b6ee809

Please sign in to comment.