sasl: Make this crate no_std

We mostly had to import from alloc some structs that are part of the std
prelude, such as Vec and String.
This commit is contained in:
Emmanuel Gil Peyrot 2024-09-25 21:55:02 +02:00
commit dc842c44d1
14 changed files with 57 additions and 19 deletions

View file

@ -1,5 +1,7 @@
use crate::common::Identity;
use crate::server::{Mechanism, MechanismError, Response};
use alloc::format;
use alloc::vec::Vec;
use getrandom::getrandom;

View file

@ -1,6 +1,8 @@
use crate::common::Identity;
use crate::secret;
use crate::server::{Mechanism, MechanismError, Response, Validator};
use alloc::string::String;
use alloc::vec::Vec;
pub struct Plain<V: Validator<secret::Plain>> {
validator: V,

View file

@ -1,4 +1,8 @@
use std::marker::PhantomData;
use alloc::borrow::ToOwned;
use alloc::format;
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use core::marker::PhantomData;
use base64::{engine::general_purpose::STANDARD as Base64, Engine};

View file

@ -1,6 +1,8 @@
use crate::common::Identity;
use crate::secret::Secret;
use std::fmt;
use alloc::vec::Vec;
use core::error::Error;
use core::fmt;
#[cfg(feature = "scram")]
use crate::common::scram::DeriveError;
@ -171,7 +173,6 @@ impl Error for ProviderError {}
impl Error for ValidatorError {}
use std::error::Error;
impl Error for MechanismError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
match self {