Skip to content

Commit 07f02ea

Browse files
committed
fix: set MSRV to 1.81
The cbor4ii crate has a minumum supported Rust version of 1.81, hence do we. This makes it possible to remove the `codec` feature and just have those traits always implemented. Also switch to the Rust 2021 edition.
1 parent a8fa998 commit 07f02ea

4 files changed

Lines changed: 6 additions & 12 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ license = "MIT/Apache-2.0"
1212
description = "IPLD DAG-CBOR support for Serde."
1313
keywords = ["serde", "cbor", "serialization", "no_std"]
1414
categories = ["encoding"]
15-
edition = "2018"
15+
edition = "2021"
16+
rust-version = "1.81"
1617

1718
[dependencies]
1819
cbor4ii = { version = "1.2.2", default-features = false, features = ["use_alloc"] }
19-
ipld-core = { version = "0.4.2", default-features = false, features = ["serde"] }
20+
ipld-core = { version = "0.4.2", default-features = false, features = ["serde", "codec"] }
2021
scopeguard = { version = "1.1.0", default-features = false }
2122
serde = { version = "1.0.164", default-features = false, features = ["alloc"] }
2223

@@ -30,10 +31,8 @@ serde_tuple = "1.1.0"
3031
serde = { version = "1.0.164", default-features = false, features = ["rc"] }
3132

3233
[features]
33-
default = ["codec", "std"]
34+
default = ["std"]
3435
std = ["cbor4ii/use_std", "ipld-core/std", "serde/std", "serde_bytes/std"]
35-
# Enable the `Codec` trait implementation. It's a separate feature as it needs Rust >= 1.75.
36-
codec = ["ipld-core/codec"]
3736
# Prevent deserializing CIDs as bytes as much as possible.
3837
no-cid-as-bytes = []
3938
# Don't be as strict on decoding data as on the encoding side.

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ fn main() -> Result<(), Box<dyn Error>> {
7070
Features
7171
--------
7272

73-
### `codec`
74-
75-
The `codec` feature is enabled by default, it provides the `Codec` trait, which enables encoding and decoding independent of the IPLD Codec. The minimum supported Rust version (MSRV) can significantly be reduced to 1.64 by disabling this feature.
76-
77-
7873
### `less-strict-decoding`
7974

8075
The decoding of data is as strict as possible. When enabling this feature, it's a bit less strict. If you run into decoding errors for your not fully DAG-CBOR compliant data, try this feature flag first.

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ extern crate alloc;
117117
mod cbor4ii_nonpub;
118118
// The `Codec` implementation is only available if the `no-cid-as-bytes` feature is disabled, due
119119
// to the links being extracted with a Serde based approach.
120-
#[cfg(all(feature = "std", not(feature = "no-cid-as-bytes"), feature = "codec"))]
120+
#[cfg(all(feature = "std", not(feature = "no-cid-as-bytes")))]
121121
pub mod codec;
122122
pub mod de;
123123
pub mod error;

tests/std_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use serde_derive::{Deserialize, Serialize};
33
use serde_ipld_dagcbor::{from_slice, to_vec};
44

55
fn to_binary(s: &'static str) -> Vec<u8> {
6-
assert!(s.len().is_multiple_of(2));
6+
assert!(s.len() % 2 == 0);
77
let mut b = Vec::with_capacity(s.len() / 2);
88
for i in 0..s.len() / 2 {
99
b.push(u8::from_str_radix(&s[i * 2..(i + 1) * 2], 16).unwrap());

0 commit comments

Comments
 (0)