Add GitHub Actions CI and update README

This commit is contained in:
Pyfisch
2021-03-29 21:03:42 +02:00
parent 2916e56d76
commit 70b12bc967
3 changed files with 70 additions and 4 deletions
+64
View File
@@ -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
-3
View File
@@ -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 = []
+6 -1
View File
@@ -2,7 +2,7 @@
[![Build Status](https://travis-ci.org/pyfisch/httpdate.svg?branch=master)](https://travis-ci.org/pyfisch/httpdate)
[![Crates.io](https://img.shields.io/crates/v/httpdate.svg)](https://crates.io/crates/httpdate)
[Documentation](https://pyfisch.github.io/httpdate/httpdate/index.html)
[![Documentation](https://docs.rs/httpdate/badge.svg)](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.