Skip to content

Commit 0702439

Browse files
committed
Updated crates and range syntax
1 parent 7fc4a01 commit 0702439

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "asn1_der"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
authors = ["KizzyCode Software Labs./Keziah Biermann <[email protected]>"]
55
description = "This crate provides a simple ASN.1-DER en-/decoder"
66
license = "BSD-2-Clause OR MIT"
@@ -26,7 +26,7 @@ overflow-checks = true
2626

2727
[dependencies.asn1_der_derive]
2828
optional = true
29-
version = "0.1.1"
29+
version = "0.1.2"
3030
path = "./asn1_der_derive"
3131

3232

src/der/length.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl DerLength {
1616
pub fn deserialize<'a>(mut source: impl Iterator<Item = &'a u8>) -> Result<Self, Asn1DerError> {
1717
match *source.next().ok_or(Asn1DerError::LengthMismatch)? as usize {
1818
// Decode simple length
19-
b @ 0...127 => Ok(Self{ len: b }),
19+
b @ 0..=127 => Ok(Self{ len: b }),
2020

2121
// Decode complex length
2222
b => match b & 0x0f {
@@ -40,7 +40,7 @@ impl DerLength {
4040
pub fn serialized_len(&self) -> usize {
4141
match self.len {
4242
// Simple length
43-
0...127 => 1,
43+
0..=127 => 1,
4444
// Complex length
4545
len => 1 + USIZE_LEN - (len.leading_zeros() / 8) as usize
4646
}
@@ -52,7 +52,7 @@ impl DerLength {
5252
let serialized_len = self.serialized_len();
5353
match self.len {
5454
// Encode simple length
55-
len @ 0...127 => *buf.next().ok_or(Asn1DerError::LengthMismatch)? = len as u8,
55+
len @ 0..=127 => *buf.next().ok_or(Asn1DerError::LengthMismatch)? = len as u8,
5656

5757
// Encode complex length
5858
len => {

0 commit comments

Comments
 (0)