Skip to content

Commit

Permalink
chore: disable check by default, prepare release 2.0.0 (#52)
Browse files Browse the repository at this point in the history
* chore: disable check by default, prepare release 2.0.0

* doc: update year in headers

* style: fix clippy warnings

* doc: correct bench cmd
  • Loading branch information
h4sh3d authored Sep 15, 2023
1 parent c2a5219 commit d138a38
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
components: clippy

- name: Run Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
run: cargo clippy --workspace --all-targets --all-features -- -D warnings

mdtomlfmt:
name: Generic format (md,toml)
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ jobs:

- uses: Swatinem/[email protected]

- name: Build with no default features
run: cargo build --verbose --no-default-features
- name: Base build
run: cargo build --verbose

- name: Build with feature 'check'
run: cargo build --verbose --no-default-features --features check
run: cargo build --verbose --features check

- name: Build with feature 'stream'
run: cargo build --verbose --no-default-features --features stream
run: cargo build --verbose --features stream

- name: Build full features
run: cargo build --verbose
run: cargo build --verbose --all-features

- name: Build wasm with check feature
run: cargo build --verbose --target wasm32-unknown-unknown --no-default-features --features check
Expand Down
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Rust edition `2021` and MSRV `1.63.0`

### Fixed

- Backward compatibility is guarantee when default features are not disabled in downstream crates
- `check` feature is disabled by default

## (YANKED) [1.1.0] - 2023-03-11

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rust-version = "1.63.0"
std = ["thiserror"]
check = ["tiny-keccak"]
stream = ["std", "tokio", "async-stream", "futures-util"]
default = ["std", "check"]
default = ["std"]

[dependencies]
async-stream = { version = "0.3", optional = true, default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2022 Monero Rust Contributors
Copyright (c) 2019-2023 Monero Rust Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ The alphabet is composed of 58 characters visually not similar to avoid confusio

## Features

By default only `check` and `std` features are enabled. If you don't want to include all default
By default only the `std` feature is enabled. If you want to opt-out remove default features
features in your project:

```toml
[dependencies.base58-monero]
version = "1"
version = "2"
default-features = false
```

Expand All @@ -43,7 +43,7 @@ is enabled.

### `check`

Enables `encode_check` and `decode_check` functions. By default `check` feature is enable.
Enables `encode_check` and `decode_check` functions. By default `check` feature is disabled.

### `stream`

Expand All @@ -56,7 +56,7 @@ amount of data or in asyncronous environment. `stream` can be used with `check`

```toml
[dependencies.base58-monero]
version = "1"
version = "2"
features = ["stream"]
```

Expand All @@ -82,7 +82,11 @@ Performances are shown in nanosecond per iteration of compute, the smaller the b

Check versions compute or verify the checksum while encoding or decoding the data.

Benchmarks can be found under `/benches` and run with `cargo +nightly bench`.
Benchmarks can be found under `/benches` and run with

```
cargo +nightly bench --all-features
```

## Releases and Changelog

Expand Down
4 changes: 2 additions & 2 deletions src/base58.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Rust Monero Base58 Library
// Written in 2019-2022 by
// Written in 2019-2023 by
// Monero Rust Contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -486,7 +486,7 @@ where
check[i] = buf[(clen - CHECKSUM_SIZE + i) % len];
}

if check != &checksum[..CHECKSUM_SIZE] {
if check != checksum[..CHECKSUM_SIZE] {
Err(Error::InvalidChecksum)?;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Rust Monero Base58 Library
// Written in 2019-2022 by
// Written in 2019-2023 by
// Monero Rust Contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -33,16 +33,16 @@
//! * `check`: enable encoding/decoding base58 strings with a 4 bytes tail checksum.
//! * `stream`: enable encoding/decoding base58 asyncronous streams of data.
//!
//! Only `check` and `std` features are enabled by default, to remove it use:
//! Only the `std` feature is enabled by default, to use this crate in `no_std` environment use:
//!
//! ```text
//! base58-monero = { version = "1", default-features = false }
//! base58-monero = { version = "2", default-features = false }
//! ```
//!
//! or to enable `stream` one use:
//!
//! ```text
//! base58-monero = { version = "1", features = ["stream"] }
//! base58-monero = { version = "2", features = ["stream"] }
//! ```
//!
//! ## Examples
Expand Down

0 comments on commit d138a38

Please sign in to comment.