summaryrefslogtreecommitdiffstats
path: root/vendor/der/src/asn1/boolean.rs
diff options
context:
space:
mode:
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;