From 2c2f1abb9a32738070309cd654afdf0622756032 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 2 Nov 2023 15:42:00 +0100 Subject: [PATCH] switch from std::prelude to core::prelude to make all non-core imports explicit --- src/lib.rs | 7 ++++++- src/pemfile.rs | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a560635..b948f54 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,6 +40,11 @@ unused_extern_crates, unused_qualifications )] +#![cfg_attr(not(test), no_std)] + +extern crate alloc; +#[cfg(not(test))] +extern crate std; #[cfg(test)] mod tests; @@ -53,9 +58,9 @@ use pki_types::{ PrivateSec1KeyDer, }; +use core::iter; /// --- Legacy APIs: use std::io; -use std::iter; /// Return an iterator over certificates from `rd`. /// diff --git a/src/pemfile.rs b/src/pemfile.rs index 476f220..e4ae5a1 100644 --- a/src/pemfile.rs +++ b/src/pemfile.rs @@ -1,5 +1,9 @@ +use alloc::borrow::ToOwned; +use alloc::format; +use alloc::string::String; +use alloc::vec::Vec; +use core::iter; use std::io::{self, ErrorKind}; -use std::iter; use pki_types::{ CertificateDer, CertificateRevocationListDer, PrivatePkcs1KeyDer, PrivatePkcs8KeyDer,