Skip to content

Commit

Permalink
Merge #504
Browse files Browse the repository at this point in the history
504: Merge master into 0.8.x r=kinggoesgaming a=KodrAus

This PR merges the current `master` branch into `0.8.x` along with a new commit that reverts the breaking change to `from_guid`. I'll give the diff another look over, but this should let us push a new `0.8.x` release with the last year's worth of effort.

Closes:

- #475 

Co-authored-by: Hunar Roop Kahlon <[email protected]>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Jason Nader <[email protected]>
  • Loading branch information
4 people authored Dec 24, 2020
2 parents fb62500 + 94ce240 commit 4b15a39
Show file tree
Hide file tree
Showing 20 changed files with 661 additions and 369 deletions.
159 changes: 159 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Continuous integration

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:
os_tests:
name: "Tests/OS: ${{ matrix.os }} - ${{ matrix.channel }}-${{ matrix.rust_target }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
exclude:
- os: macos-10.15
rust_target: x86_64-gnu
- os: macos-10.15
rust_target: x86_64-msvc
- os: windows-2019
rust_target: x86_64-apple-darwin
- os: ubuntu-20.04
rust_target: x86_64-msvc
- os: ubuntu-20.04
rust_target: x86_64-apple-darwin
channel:
- stable
- beta
- nightly
- 1.34.0
os:
- macos-10.15
- windows-2019
- ubuntu-20.04
rust_target:
- x86_64-gnu
- x86_64-msvc
- x86_64-apple-darwin

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: ${{ matrix.channel }}-${{ matrix.rust_target }}

- name: Build with --no-default-features
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- name: Test with --no-default-features
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features

- name: Build with --all-features
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
- name: Test with --all-features
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features

- name: Build with default features
uses: actions-rs/cargo@v1
with:
command: build
- name: Test with default features
uses: actions-rs/cargo@v1
with:
command: test

- name: Build with --features guid
uses: actions-rs/cargo@v1
with:
command: build
args: --features guid
- name: Test with --features guid
uses: actions-rs/cargo@v1
with:
command: test
args: --features guid

- name: Build with --features serde
uses: actions-rs/cargo@v1
with:
command: build
args: --features serde
- name: Test with --features serde
uses: actions-rs/cargo@v1
with:
command: test
args: --features serde

- name: Build with --features slog
uses: actions-rs/cargo@v1
with:
command: build
args: --features slog
- name: Test with --features slog
uses: actions-rs/cargo@v1
with:
command: test
args: --features slog

- name: Build with --features v1
uses: actions-rs/cargo@v1
with:
command: build
args: --features v1
- name: Test with --features serde
uses: actions-rs/cargo@v1
with:
command: test
args: --features v1

- name: Build with --features v3
uses: actions-rs/cargo@v1
with:
command: build
args: --features v3
- name: Test with --features v3
uses: actions-rs/cargo@v1
with:
command: test
args: --features v3

- name: Build with --features v4
uses: actions-rs/cargo@v1
with:
command: build
args: --features v4
- name: Test with --features v4
uses: actions-rs/cargo@v1
with:
command: test
args: --features v4

- name: Build with --features v5
uses: actions-rs/cargo@v1
with:
command: build
args: --features v5
- name: Test with --features v5
uses: actions-rs/cargo@v1
with:
command: test
args: --features v5
41 changes: 41 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Clippy

on: [push, pull_request]

jobs:
linux-clippy:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Toolchain
uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
profile: minimal
toolchain: 1.34.0
- name: Run `cargo clippy`
uses: actions-rs/cargo@v1
with:
command: clippy
args: --features "serde slog std v1 v3 v4 v5" -- -D warnings
windows-clippy:
name: Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Toolchain
uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
profile: minimal
toolchain: 1.34.0
- name: Run `cargo clippy`
uses: actions-rs/cargo@v1
with:
command: clippy
args: --features "guid serde slog std v1 v3 v4 v5" -- -D warnings
22 changes: 22 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Format Check

on: [push, pull_request]

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Toolchain
uses: actions-rs/toolchain@v1
with:
components: rustfmt
override: true
profile: minimal
toolchain: 1.34.0
- name: Run `cargo fmt`
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
20 changes: 3 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ matrix:
rust: nightly
- rust: nightly
env:
- LABEL="fmt + cargo-web"
- LABEL="cargo-web"
before_script:
- rustup component add rustfmt-preview
- cargo install cargo-web
script:
- cargo fmt --all -- --check
- cargo test --features "serde std v1 v3 v4 v5"
- cargo bench --features "serde std v1 v3 v4 v5"
- cargo web build --features "v3 stdweb"
Expand All @@ -35,12 +33,10 @@ matrix:
- cargo web build --features "v5 wasm-bindgen"
- rust: stable
env:
- LABEL="clippy + wasm"
- LABEL="wasm"
before_script:
- rustup component add clippy-preview
- rustup target add wasm32-unknown-unknown
script:
- cargo clippy --features "v1 v3 v4 v5 slog"
- cargo build --target wasm32-unknown-unknown --features "v3 wasm-bindgen"
- cargo build --target wasm32-unknown-unknown --features "v4 wasm-bindgen"
- cargo build --target wasm32-unknown-unknown --features "v5 wasm-bindgen"
Expand All @@ -51,23 +47,13 @@ matrix:
- rustup target add thumbv6m-none-eabi
script:
- cargo build --no-default-features --target thumbv6m-none-eabi
- rust: 1.32.0
env:
- LABEL="msrv"
script:
- cargo test --features "serde std v4"


notifications:
email:
on_success: never

os: linux

rust:
- stable
- beta
- nightly

script:
- cargo build --no-default-features
- cargo build --all-features
Expand Down
13 changes: 6 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,16 @@ status = "actively-developed"
[badges.travis-ci]
repository = "uuid-rs/uuid"

[dependencies.md5]
[dependencies.getrandom]
optional = true
version = "0.6"
version = "0.2.0"

[dependencies.rand]
[dependencies.md5]
optional = true
version = "0.7"

[dependencies.serde]
default-features = false
features = [ "serde_derive" ]
optional = true
version = "1.0.56"

Expand Down Expand Up @@ -92,12 +91,12 @@ version = "1.0.56"
default = ["std"]
guid = ["winapi"]
std = []
stdweb = [ "rand/stdweb" ]
stdweb = ["getrandom", "getrandom/js"]
v1 = []
v3 = ["md5"]
v4 = ["rand"]
v4 = ["getrandom"]
v5 = ["sha1"]
wasm-bindgen = ["rand/wasm-bindgen"]
wasm-bindgen = ["getrandom", "getrandom/js"]

[target.'cfg(windows)'.dependencies.winapi]
optional = true
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ uuid

[![Latest Version](https://img.shields.io/crates/v/uuid.svg)](https://crates.io/crates/uuid)
[![Join the chat at https://gitter.im/uuid-rs/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/uuid-rs/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.31.0+-yellow.svg)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.34.0+-yellow.svg)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/uuid-rs/uuid?branch=master&svg=true)](https://ci.appveyor.com/project/uuid-rs/uuid/branch/master)
[![Build Status](https://travis-ci.org/uuid-rs/uuid.svg?branch=master)](https://travis-ci.org/uuid-rs/uuid)
[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/uuid-rs/uuid.svg)](https://isitmaintained.com/project/uuid-rs/uuid "Average time to resolve an issue")
[![Percentage of issues still open](https://isitmaintained.com/badge/open/uuid-rs/uuid.svg)](https://isitmaintained.com/project/uuid-rs/uuid "Percentage of issues still open")
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fuuid-rs%2Fuuid.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fuuid-rs%2Fuuid?ref=badge_shield)

---

Expand All @@ -18,7 +19,7 @@ unique 128-bit number, stored as 16 octets. UUIDs are used to assign
unique identifiers to entities without requiring a central allocating
authority.

They are particularly useful in distributed systems, though can be used in
They are particularly useful in distributed systems, though they can be used in
disparate areas, such as databases and network protocols. Typically a UUID
is displayed in a readable string form as a sequence of hexadecimal digits,
separated into groups by hyphens.
Expand Down Expand Up @@ -46,7 +47,7 @@ various pieces of functionality:
`serde` crate.

You need to enable one of the following Cargo features together with
`v3`, `v4` or `v5` feature if you're targeting `wasm32` architecture:
`v3`, `v4` or `v5` feature if you're targeting `wasm32-unknown-unknown` target:

* `stdweb` - enables support for `OsRng` on `wasm32-unknown-unknown` via
`stdweb` combined with `cargo-web`
Expand Down Expand Up @@ -81,10 +82,11 @@ To parse a UUID given in the simple format and print it as a urn:
```rust
use uuid::Uuid;

fn main() {
fn main() -> Result<(), uuid::Error> {
let my_uuid =
Uuid::parse_str("936DA01F9ABD4d9d80C702AF85C822A8").unwrap();
Uuid::parse_str("936DA01F9ABD4d9d80C702AF85C822A8")?;
println!("{}", my_uuid.to_urn());
Ok(())
}
```

Expand All @@ -98,6 +100,7 @@ use uuid::Uuid;
fn main() {
let my_uuid = Uuid::new_v4();
println!("{}", my_uuid);
Ok(())
}
```

Expand Down Expand Up @@ -128,8 +131,11 @@ Licensed under either of

at your option.


[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fuuid-rs%2Fuuid.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fuuid-rs%2Fuuid?ref=badge_large)

## Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
be dual licensed as above, without any additional terms or conditions.
2 changes: 1 addition & 1 deletion README.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![Latest Version](https://img.shields.io/crates/v/uuid.svg)](https://crates.io/crates/uuid)
[![Join the chat at https://gitter.im/uuid-rs/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/uuid-rs/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.31.0+-yellow.svg)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.34.0+-yellow.svg)
{{badges}}

---
Expand Down
Loading

0 comments on commit 4b15a39

Please sign in to comment.