diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5e4cf97..59f7656 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -27,7 +27,7 @@ assignees: '' **Version** - - OS: + - OS: - Rust: **Notes** diff --git a/.travis/build.sh b/.travis/build.sh index 46e60d0..3738495 100644 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -52,10 +52,8 @@ if [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_RUST_VERSION == "nightly" ]; t cargo install-update cargo-update cargo install cargo-audit cargo install-update cargo-audit - RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin --git "https://github.com/xd009642/tarpaulin.git" --branch "develop" - RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install-update cargo-tarpaulin -g - cargo install cargo-travis --git "https://github.com/daxpedda/cargo-travis.git" --branch "temporary" - cargo install-update cargo-travis -g + cargo install cargo-travis --git "https://github.com/roblabla/cargo-travis.git" + cargo install-update cargo-travis --git # check rust RustSec db cargo audit || exit_code=1 @@ -67,14 +65,7 @@ if [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_RUST_VERSION == "nightly" ]; t eval "$(ssh-agent -s)" ssh-add ".travis/github_deploy_key" # upload documentation - cargo doc-upload --branch $TRAVIS_BRANCH --clobber-index || exit_code=1 - - # do some test coverage - cargo tarpaulin --out Xml --ignore-tests --verbose || exit_code=1 - bash <(curl -s https://codecov.io/bash) || exit_code=1 - # do some more test coverage in release mode - cargo tarpaulin --release --out Xml --ignore-tests --verbose || exit_code=1 - bash <(curl -s https://codecov.io/bash) || exit_code=1 + cargo doc-upload --branch $TRAVIS_BRANCH --clobber-index --path $TRAVIS_BRANCH/doc/ || exit_code=1 fi # pass the exit code to travis diff --git a/Cargo.toml b/Cargo.toml index 24664f0..b2b0039 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,10 @@ [package] name = "unchecked_unwrap" -version = "1.0.0" +version = "1.0.1" authors = ["daxpedda "] edition = "2018" description = "Adds an unchecked version of `unwrap()` and `expect()` to Option and Result." documentation = "https://docs.rs/crate/unchecked_unwrap/" -homepage = "https://github.com/daxpedda/unchecked_unwrap/" repository = "https://github.com/daxpedda/unchecked_unwrap/tree/stable/" readme = "README.MD" keywords = ["unwrap", "unchecked", "expect", "result", "option"] @@ -15,11 +14,9 @@ exclude = ["/.travis.yml", "/.github/*", "/.travis/*"] [badges] travis-ci = { repository = "daxpedda/unchecked_unwrap", branch = "stable" } -# TODO: wait for tarpaulin to fix some issues regarding uncovered lines -# codecov = { repository = "daxpedda/unchecked_unwrap", branch = "stable" } # this looks excessive for a small library like that -#is-it-maintained-issue-resolution = { repository = "daxpedda/unchecked_unwrap" } -#is-it-maintained-open-issues = { repository = "daxpedda/unchecked_unwrap" } +# is-it-maintained-issue-resolution = { repository = "daxpedda/unchecked_unwrap" } +# is-it-maintained-open-issues = { repository = "daxpedda/unchecked_unwrap" } maintenance = { status = "actively-developed" } [features] @@ -27,9 +24,11 @@ default = ["debug_checks"] debug_checks = [] doc_include = [] +# cleaning some output from `cargo test` and `cargo bench` [lib] test = false bench = false +# docs.rs needs some pointers to do proper documentation [package.metadata.docs.rs] features = ["doc_include"] diff --git a/README.md b/README.md index 07bc650..61974b9 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,12 @@ **[Release](https://github.com/daxpedda/unchecked_unwrap/tree/release/):** [![Build](https://img.shields.io/travis/daxpedda/unchecked_unwrap/release.svg?label=build:%20release)](https://travis-ci.org/daxpedda/unchecked_unwrap/branches/) [![Docs](https://docs.rs/unchecked_unwrap/badge.svg)](https://docs.rs/unchecked_unwrap/) -[![Coverage](https://img.shields.io/codecov/c/github/daxpedda/unchecked_unwrap/release.svg?label=coverage:%20release)](https://codecov.io/github/daxpedda/unchecked_unwrap/branch/release/) **[Master](https://github.com/daxpedda/unchecked_unwrap/):** [![Build](https://img.shields.io/travis/daxpedda/unchecked_unwrap/master.svg?label=build:%20master)](https://travis-ci.org/daxpedda/unchecked_unwrap/branches/) -[![Docs](https://raw.githack.com/daxpedda/unchecked_unwrap/gh-pages/master/badge.svg)](https://daxpedda.github.io/unchecked_unwrap/master/index.html) -[![Coverage](https://img.shields.io/codecov/c/github/daxpedda/unchecked_unwrap/master.svg?label=coverage:%20master)](https://codecov.io/github/daxpedda/unchecked_unwrap/branch/master/) +[![Docs](https://img.shields.io/badge/endpoint.svg?url=https://daxpedda.github.io/unchecked_unwrap/master/doc/badge.json)](https://daxpedda.github.io/unchecked_unwrap/master/doc/index.html) -Adds an unchecked version of `unwrap()` and `expect()` to `Option` and `Result` for the rust programmming language. +Adds an unchecked version of `unwrap()` and `expect()` to `Option` and `Result` for the rust programming language. Supports `no_std`. ## Branches @@ -51,18 +49,13 @@ assert_eq!(unsafe { x.unchecked_expect("the sky is falling down") }, 2); ## Documentation Documentation is available online in the badge links above. -Currently nightly is needed for full documentation: `cargo doc --features doc_include` -If you are not on nightly only use `cargo doc`. +Currently, nightly is needed for full documentation: `cargo doc --features doc_include` +If you are not using nightly, use `cargo doc` as usual. ## Tests Is as simple as `cargo test` and `cargo test --release`. -## Test coverage - -Test coverage is currently done by [Tarpaulin](https://github.com/xd009642/tarpaulin), which currently is missing some lines. -I removed the badge from [Crates.io](https://crates.io/crates/unchecked_unwrap/) because it is misleading. - ## Benchmarking Is as simple as `cargo bench`. @@ -70,7 +63,7 @@ Currently the nightly version of rust is needed for benchmarking. ## CI -This crate is checked daily by CI to make sure that it builds successfully with the newest versions rust stable, beta and nightly. +This crate is checked daily by CI to make sure that it builds successfully with the newest versions of rust stable, beta and nightly. ## Alternatives diff --git a/bench.json b/bench.json deleted file mode 100644 index 2394a20..0000000 --- a/bench.json +++ /dev/null @@ -1,8 +0,0 @@ - 671 ns/iter (+/- 11) checked::expect_option - 670 ns/iter (+/- 8) checked::expect_result - 672 ns/iter (+/- 7) checked::unwrap_option - 670 ns/iter (+/- 15) checked::unwrap_result - 296 ns/iter (+/- 21) unchecked::expect_option - 295 ns/iter (+/- 129) unchecked::expect_result - 295 ns/iter (+/- 30) unchecked::unwrap_option - 295 ns/iter (+/- 13) unchecked::unwrap_result