Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions der/src/reader/pem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::{EncodingRules, Error, ErrorKind, Length, Result};
use pem_rfc7468::Decoder;

/// `Reader` type which decodes PEM on-the-fly.
#[cfg(feature = "pem")]
#[derive(Clone)]
pub struct PemReader<'i> {
/// Inner PEM decoder.
Expand All @@ -18,7 +17,6 @@ pub struct PemReader<'i> {
position: Position,
}

#[cfg(feature = "pem")]
impl<'i> PemReader<'i> {
/// Create a new PEM reader which decodes data on-the-fly.
///
Expand All @@ -41,8 +39,7 @@ impl<'i> PemReader<'i> {
}
}

#[cfg(feature = "pem")]
impl<'i> Reader<'i> for PemReader<'i> {
impl<'i> Reader<'static> for PemReader<'i> {
const CAN_READ_SLICE: bool = false;

fn encoding_rules(&self) -> EncodingRules {
Expand All @@ -68,7 +65,7 @@ impl<'i> Reader<'i> for PemReader<'i> {
ret
}

fn read_slice(&mut self, _len: Length) -> Result<&'i [u8]> {
fn read_slice(&mut self, _len: Length) -> Result<&'static [u8]> {
// Can't borrow from PEM because it requires decoding
Err(self.error(ErrorKind::Reader))
}
Expand Down