Skip to content

Commit 5e2fe89

Browse files
authored
const-oid: remove std feature; MSRV 1.81 (#1535)
Leverages stable support for `core::error::Error` in lieu of `std::error::Error`. Since this was the only usage of `std`, also removes the `std` feature.
1 parent cabf437 commit 5e2fe89

File tree

10 files changed

+17
-23
lines changed

10 files changed

+17
-23
lines changed

.github/workflows/const-oid.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
rust:
26-
- 1.71.0 # MSRV
26+
- 1.81.0 # MSRV
2727
- stable
2828
target:
2929
- thumbv7em-none-eabi
@@ -40,14 +40,14 @@ jobs:
4040
minimal-versions:
4141
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
4242
with:
43-
working-directory: ${{ github.workflow }}
43+
working-directory: ${{ github.workflow }}
4444

4545
test:
4646
runs-on: ubuntu-latest
4747
strategy:
4848
matrix:
4949
rust:
50-
- 1.71.0 # MSRV
50+
- 1.81.0 # MSRV
5151
- stable
5252
steps:
5353
- uses: actions/checkout@v4

.github/workflows/der.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
rust:
28-
- 1.71.0 # MSRV
28+
- 1.81.0 # MSRV
2929
- stable
3030
target:
3131
- thumbv7em-none-eabi
@@ -52,7 +52,7 @@ jobs:
5252
# 32-bit Linux
5353
- targets: i686-unknown-linux-gnu
5454
platform: ubuntu-latest
55-
rust: 1.71.0 # MSRV
55+
rust: 1.81.0 # MSRV
5656
deps: sudo apt update && sudo apt install gcc-multilib
5757
- targets: i686-unknown-linux-gnu
5858
platform: ubuntu-latest
@@ -62,7 +62,7 @@ jobs:
6262
# 64-bit Linux
6363
- targets: x86_64-unknown-linux-gnu
6464
platform: ubuntu-latest
65-
rust: 1.71.0 # MSRV
65+
rust: 1.81.0 # MSRV
6666
- targets: x86_64-unknown-linux-gnu
6767
platform: ubuntu-latest
6868
rust: stable
@@ -71,7 +71,7 @@ jobs:
7171
# 64-bit Windows
7272
#- targets: x86_64-pc-windows-msvc
7373
# platform: windows-latest
74-
# rust: 1.71.0 # MSRV
74+
# rust: 1.81.0 # MSRV
7575
#- targets: x86_64-pc-windows-msvc
7676
# platform: windows-latest
7777
# rust: stable
@@ -91,7 +91,7 @@ jobs:
9191
strategy:
9292
matrix:
9393
rust:
94-
- 1.71.0 # MSRV
94+
- 1.81.0 # MSRV
9595
- stable
9696
steps:
9797
- uses: actions/checkout@v4

const-oid/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ categories = ["cryptography", "data-structures", "encoding", "no-std", "parser-i
1515
keywords = ["iso", "iec", "itu", "oid"]
1616
readme = "README.md"
1717
edition = "2021"
18-
rust-version = "1.71"
18+
rust-version = "1.81"
1919

2020
[dependencies]
2121
arbitrary = { version = "1.2", optional = true, features = ["derive"] }
@@ -25,7 +25,6 @@ hex-literal = "0.4"
2525

2626
[features]
2727
db = []
28-
std = []
2928

3029
[package.metadata.docs.rs]
3130
all-features = true

const-oid/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ well as a runtime OID library.
5757

5858
## Minimum Supported Rust Version
5959

60-
This crate requires **Rust 1.71** at a minimum.
60+
This crate requires **Rust 1.81** at a minimum.
6161

6262
We may change the MSRV in the future, but it will be accompanied by a minor
6363
version bump.
@@ -84,7 +84,7 @@ dual licensed as above, without any additional terms or conditions.
8484
[docs-image]: https://docs.rs/const-oid/badge.svg
8585
[docs-link]: https://docs.rs/const-oid/
8686
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
87-
[rustc-image]: https://img.shields.io/badge/rustc-1.71+-blue.svg
87+
[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg
8888
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
8989
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/300570-formats
9090
[build-image]: https://github.com/RustCrypto/formats/workflows/const-oid/badge.svg?branch=master&event=push

const-oid/src/error.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,4 @@ impl fmt::Display for Error {
7474
}
7575
}
7676

77-
#[cfg(feature = "std")]
78-
impl std::error::Error for Error {}
77+
impl core::error::Error for Error {}

const-oid/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
unused_qualifications
2020
)]
2121

22-
#[cfg(feature = "std")]
23-
extern crate std;
24-
2522
#[macro_use]
2623
mod checked;
2724

der/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ categories = ["cryptography", "data-structures", "encoding", "no-std", "parser-i
1414
keywords = ["asn1", "crypto", "itu", "pkcs"]
1515
readme = "README.md"
1616
edition = "2021"
17-
rust-version = "1.71"
17+
rust-version = "1.81"
1818

1919
[dependencies]
2020
arbitrary = { version = "1.3", features = ["derive"], optional = true }

der/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ encountered. There is currently no way to disable these checks.
4949

5050
## Minimum Supported Rust Version
5151

52-
This crate requires **Rust 1.71** at a minimum.
52+
This crate requires **Rust 1.81** at a minimum.
5353

5454
We may change the MSRV in the future, but it will be accompanied by a minor
5555
version bump.
@@ -78,7 +78,7 @@ dual licensed as above, without any additional terms or conditions.
7878
[build-image]: https://github.com/RustCrypto/formats/actions/workflows/der.yml/badge.svg
7979
[build-link]: https://github.com/RustCrypto/formats/actions/workflows/der.yml
8080
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
81-
[rustc-image]: https://img.shields.io/badge/rustc-1.71+-blue.svg
81+
[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg
8282
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
8383
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/300570-formats
8484

der/src/reader/slice.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ impl<'a> Reader<'a> for SliceReader<'a> {
130130
return Err(self.error(ErrorKind::Failed).into());
131131
}
132132

133-
T::decode(self).map_err(|e| {
133+
T::decode(self).inspect_err(|_| {
134134
self.failed = true;
135-
e
136135
})
137136
}
138137

x509-cert/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ x509-cert-test-support = { path = "./test-support" }
4141

4242
[features]
4343
default = ["pem", "std"]
44-
std = ["const-oid/std", "der/std", "spki/std", "tls_codec?/std"]
44+
std = ["der/std", "spki/std", "tls_codec?/std"]
4545

4646
arbitrary = ["dep:arbitrary", "std", "der/arbitrary", "spki/arbitrary"]
4747
builder = ["async-signature", "std", "sha1/default", "signature"]

0 commit comments

Comments
 (0)