-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Add
now()
; remove chrono integration for now. (#15)
- Loading branch information
1 parent
6aff845
commit 670ba05
Showing
20 changed files
with
329 additions
and
574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: coverage | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
test: | ||
name: coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install tarpaulin. | ||
run: cargo install cargo-tarpaulin | ||
- name: Generate code coverage | ||
run: | | ||
cargo tarpaulin --verbose --out xml --engine llvm --features serde,easter | ||
env: | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: lukesneeringer/unix-ts | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
name: release | ||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Publish the `unix-ts-macros` crate. | ||
run: cargo publish --package unix-ts-macros | ||
env: | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
- name: Publish the `unix-ts` crate. | ||
run: cargo publish --package unix-ts | ||
env: | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
printWidth: 79 | ||
printWidth: 99 | ||
proseWrap: always | ||
singleQuote: true | ||
trailingComma: es5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "unix-ts" | ||
version = "0.6.0" | ||
version = "1.0.0" | ||
edition = "2021" | ||
authors = [ | ||
"Luke Sneeringer <[email protected]>" | ||
|
@@ -20,15 +20,10 @@ exclude = [ | |
] | ||
|
||
[dependencies] | ||
chrono = { version = "0.4", optional = true } | ||
unix-ts-macros = { path = "macros", version = "0.4" } | ||
unix-ts-macros = { path = "macros", version = "1" } | ||
|
||
[dev-dependencies] | ||
chrono-tz = "^0.8.3" | ||
assert2 = "0.3" | ||
|
||
[build-dependencies] | ||
readme-rustdocifier = "0.1" | ||
|
||
[workspace] | ||
members = [".", "macros", "macros-test"] | ||
members = [".", "macros"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,5 @@ | ||
# unix-ts-macros: A macro to quickly generate unix-ts timestamps. | ||
|
||
unix-ts-macros simplifies the creation of timestamps into a procedural macro: | ||
`ts`. This is an implementation crate for `unix-ts`, which is what you should | ||
actually add as a dependency. | ||
|
||
## Usage | ||
|
||
Add the `unix-ts` crate to your `Cargo.toml` file like usual: | ||
|
||
```toml | ||
[dependencies] | ||
unix-ts = "0.2" | ||
``` | ||
|
||
You can create a timestamp with the `ts!` macro, which takes the Unix timestamp | ||
as an argument: | ||
|
||
``` | ||
use unix_ts_macros::ts; | ||
// The argument is the number of seconds since the Unix epoch. | ||
let t = ts!(1335020400); | ||
// Fractional seconds are also allowed. | ||
let t2 = ts!(1335020400.25); | ||
``` | ||
unix-ts-macros simplifies the creation of timestamps into a procedural macro: `ts`. This is an | ||
implementation crate for `unix-ts`, which is what you should actually add as a dependency. (Don't | ||
depend directly on this crate.) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.