mirror of
https://github.com/openharmony/third_party_rust_httpdate.git
synced 2026-07-01 03:15:42 -04:00
Add GitHub Actions CI and update README
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
on: [push, pull_request]
|
||||
|
||||
name: Continuous integration
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
|
||||
test:
|
||||
name: Test Suite
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- run: rustup component add rustfmt
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
clippy:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
- run: rustup component add clippy
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: -- -D warnings
|
||||
@@ -9,6 +9,3 @@ readme = "README.md"
|
||||
documentation = "https://pyfisch.github.io/httpdate/httpdate/index.html"
|
||||
repository = "https://github.com/pyfisch/httpdate"
|
||||
edition = "2018"
|
||||
|
||||
[features]
|
||||
unstable = []
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[](https://travis-ci.org/pyfisch/httpdate)
|
||||
[](https://crates.io/crates/httpdate)
|
||||
[Documentation](https://pyfisch.github.io/httpdate/httpdate/index.html)
|
||||
[](https://docs.rs/httpdate)
|
||||
|
||||
Multiple HTTP header fields store timestamps.
|
||||
For example a response created on May 15, 2015 may contain the header
|
||||
@@ -16,6 +16,11 @@ This crate provides two public functions:
|
||||
* `parse_http_date` to parse a HTTP datetime string to a system time
|
||||
* `fmt_http_date` to format a system time to a IMF-fixdate
|
||||
|
||||
In addition it exposes the `HttpDate` type that can be used to parse
|
||||
and format timestamps. Convert a sytem time to `HttpDate` and vice versa.
|
||||
The `HttpType` (8 bytes) is smaller than `SystemTime` (16 bytes) and
|
||||
using the display impl avoids a temporary allocation.
|
||||
|
||||
Read the [blog post](https://pyfisch.org/blog/http-datetime-handling/) to learn
|
||||
more.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user