summaryrefslogtreecommitdiffstats
path: root/vendor/der/src/asn1/boolean.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/der/src/asn1/boolean.rs
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/der/src/asn1/boolean.rs')
-rw-r--r--vendor/der/src/asn1/boolean.rs17
1 files changed, 3 insertions, 14 deletions
diff --git a/vendor/der/src/asn1/boolean.rs b/vendor/der/src/asn1/boolean.rs
index e03218120..3eb0f2e68 100644
--- a/vendor/der/src/asn1/boolean.rs
+++ b/vendor/der/src/asn1/boolean.rs
@@ -1,8 +1,8 @@
//! ASN.1 `BOOLEAN` support.
use crate::{
- asn1::AnyRef, ord::OrdIsValueOrd, ByteSlice, DecodeValue, EncodeValue, Error, ErrorKind,
- FixedTag, Header, Length, Reader, Result, Tag, Writer,
+ asn1::AnyRef, ord::OrdIsValueOrd, DecodeValue, EncodeValue, Error, ErrorKind, FixedTag, Header,
+ Length, Reader, Result, Tag, Writer,
};
/// Byte used to encode `true` in ASN.1 DER. From X.690 Section 11.1:
@@ -33,7 +33,7 @@ impl EncodeValue for bool {
Ok(Length::ONE)
}
- fn encode_value(&self, writer: &mut dyn Writer) -> Result<()> {
+ fn encode_value(&self, writer: &mut impl Writer) -> Result<()> {
writer.write_byte(if *self { TRUE_OCTET } else { FALSE_OCTET })
}
}
@@ -44,17 +44,6 @@ impl FixedTag for bool {
impl OrdIsValueOrd for bool {}
-impl From<bool> for AnyRef<'static> {
- fn from(value: bool) -> AnyRef<'static> {
- let value = ByteSlice::from(match value {
- false => &[FALSE_OCTET],
- true => &[TRUE_OCTET],
- });
-
- AnyRef::from_tag_and_value(Tag::Boolean, value)
- }
-}
-
impl TryFrom<AnyRef<'_>> for bool {
type Error = Error;