Remove manual doc_cfg feature because we have doc_auto_cfg
This commit is contained in:
parent
fa99c09585
commit
2103ef0191
10 changed files with 1 additions and 28 deletions
|
|
@ -10,5 +10,4 @@ pub use self::anonymous::Anonymous;
|
||||||
pub use self::plain::Plain;
|
pub use self::plain::Plain;
|
||||||
|
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
pub use self::scram::Scram;
|
pub use self::scram::Scram;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ pub enum MechanismError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
impl From<DeriveError> for MechanismError {
|
impl From<DeriveError> for MechanismError {
|
||||||
fn from(err: DeriveError) -> MechanismError {
|
fn from(err: DeriveError) -> MechanismError {
|
||||||
MechanismError::DeriveError(err)
|
MechanismError::DeriveError(err)
|
||||||
|
|
@ -42,7 +41,6 @@ impl From<DeriveError> for MechanismError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
impl From<InvalidLength> for MechanismError {
|
impl From<InvalidLength> for MechanismError {
|
||||||
fn from(err: InvalidLength) -> MechanismError {
|
fn from(err: InvalidLength) -> MechanismError {
|
||||||
MechanismError::InvalidKeyLength(err)
|
MechanismError::InvalidKeyLength(err)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ use std::collections::HashMap;
|
||||||
use std::string::FromUtf8Error;
|
use std::string::FromUtf8Error;
|
||||||
|
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
pub mod scram;
|
pub mod scram;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ use getrandom::Error as RngError;
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
/// An error while initializing the Rng.
|
/// An error while initializing the Rng.
|
||||||
RngError(RngError),
|
RngError(RngError),
|
||||||
/// An error in a SASL mechanism.
|
/// An error in a SASL mechanism.
|
||||||
|
|
@ -13,7 +12,6 @@ pub enum Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
impl From<RngError> for Error {
|
impl From<RngError> for Error {
|
||||||
fn from(err: RngError) -> Error {
|
fn from(err: RngError) -> Error {
|
||||||
Error::RngError(err)
|
Error::RngError(err)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
//#![deny(missing_docs)]
|
//#![deny(missing_docs)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
||||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
|
|
||||||
//! This crate provides a framework for SASL authentication and a few authentication mechanisms.
|
//! This crate provides a framework for SASL authentication and a few authentication mechanisms.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ pub struct Pbkdf2Sha1 {
|
||||||
|
|
||||||
impl Pbkdf2Sha1 {
|
impl Pbkdf2Sha1 {
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
pub fn derive(password: &str, salt: &[u8], iterations: u32) -> Result<Pbkdf2Sha1, DeriveError> {
|
pub fn derive(password: &str, salt: &[u8], iterations: u32) -> Result<Pbkdf2Sha1, DeriveError> {
|
||||||
use crate::common::scram::{ScramProvider, Sha1};
|
use crate::common::scram::{ScramProvider, Sha1};
|
||||||
use crate::common::Password;
|
use crate::common::Password;
|
||||||
|
|
@ -59,7 +58,6 @@ pub struct Pbkdf2Sha256 {
|
||||||
|
|
||||||
impl Pbkdf2Sha256 {
|
impl Pbkdf2Sha256 {
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
pub fn derive(
|
pub fn derive(
|
||||||
password: &str,
|
password: &str,
|
||||||
salt: &[u8],
|
salt: &[u8],
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,7 @@ mod plain;
|
||||||
mod scram;
|
mod scram;
|
||||||
|
|
||||||
#[cfg(feature = "anonymous")]
|
#[cfg(feature = "anonymous")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "anonymous")))]
|
|
||||||
pub use self::anonymous::Anonymous;
|
pub use self::anonymous::Anonymous;
|
||||||
pub use self::plain::Plain;
|
pub use self::plain::Plain;
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
pub use self::scram::Scram;
|
pub use self::scram::Scram;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ pub trait Validator<S: Secret> {
|
||||||
pub enum ProviderError {
|
pub enum ProviderError {
|
||||||
AuthenticationFailed,
|
AuthenticationFailed,
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
DeriveError(DeriveError),
|
DeriveError(DeriveError),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,10 +65,8 @@ pub enum MechanismError {
|
||||||
|
|
||||||
CannotDecodeResponse,
|
CannotDecodeResponse,
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
InvalidKeyLength(hmac::digest::InvalidLength),
|
InvalidKeyLength(hmac::digest::InvalidLength),
|
||||||
#[cfg(any(feature = "scram", feature = "anonymous"))]
|
#[cfg(any(feature = "scram", feature = "anonymous"))]
|
||||||
#[cfg_attr(docsrs, doc(cfg(any(feature = "scram", feature = "anonymous"))))]
|
|
||||||
RandomFailure(getrandom::Error),
|
RandomFailure(getrandom::Error),
|
||||||
NoProof,
|
NoProof,
|
||||||
CannotDecodeProof,
|
CannotDecodeProof,
|
||||||
|
|
@ -78,7 +75,6 @@ pub enum MechanismError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
impl From<DeriveError> for ProviderError {
|
impl From<DeriveError> for ProviderError {
|
||||||
fn from(err: DeriveError) -> ProviderError {
|
fn from(err: DeriveError) -> ProviderError {
|
||||||
ProviderError::DeriveError(err)
|
ProviderError::DeriveError(err)
|
||||||
|
|
@ -104,7 +100,6 @@ impl From<ValidatorError> for MechanismError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "scram")]
|
#[cfg(feature = "scram")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
|
||||||
impl From<hmac::digest::InvalidLength> for MechanismError {
|
impl From<hmac::digest::InvalidLength> for MechanismError {
|
||||||
fn from(err: hmac::digest::InvalidLength) -> MechanismError {
|
fn from(err: hmac::digest::InvalidLength) -> MechanismError {
|
||||||
MechanismError::InvalidKeyLength(err)
|
MechanismError::InvalidKeyLength(err)
|
||||||
|
|
@ -112,7 +107,6 @@ impl From<hmac::digest::InvalidLength> for MechanismError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(feature = "scram", feature = "anonymous"))]
|
#[cfg(any(feature = "scram", feature = "anonymous"))]
|
||||||
#[cfg_attr(docsrs, doc(cfg(any(feature = "scram", feature = "anonymous"))))]
|
|
||||||
impl From<getrandom::Error> for MechanismError {
|
impl From<getrandom::Error> for MechanismError {
|
||||||
fn from(err: getrandom::Error) -> MechanismError {
|
fn from(err: getrandom::Error) -> MechanismError {
|
||||||
MechanismError::RandomFailure(err)
|
MechanismError::RandomFailure(err)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
||||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -23,7 +23,6 @@ use of this library in parsing XML streams like specified in RFC 6120.
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
pub mod error;
|
pub mod error;
|
||||||
#[cfg(feature = "minidom")]
|
#[cfg(feature = "minidom")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "minidom")))]
|
|
||||||
pub mod minidom_compat;
|
pub mod minidom_compat;
|
||||||
mod rxml_util;
|
mod rxml_util;
|
||||||
pub mod text;
|
pub mod text;
|
||||||
|
|
@ -46,7 +45,6 @@ pub use rxml_util::Item;
|
||||||
#[doc = include_str!("from_xml_doc.md")]
|
#[doc = include_str!("from_xml_doc.md")]
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
#[cfg(feature = "macros")]
|
#[cfg(feature = "macros")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
|
|
||||||
pub use xso_proc::FromXml;
|
pub use xso_proc::FromXml;
|
||||||
|
|
||||||
/// # Make a struct or enum serialisable to XML
|
/// # Make a struct or enum serialisable to XML
|
||||||
|
|
@ -58,7 +56,6 @@ pub use xso_proc::FromXml;
|
||||||
/// documented on [`macro@FromXml`].
|
/// documented on [`macro@FromXml`].
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
#[cfg(feature = "macros")]
|
#[cfg(feature = "macros")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
|
|
||||||
pub use xso_proc::AsXml;
|
pub use xso_proc::AsXml;
|
||||||
|
|
||||||
/// Trait allowing to iterate a struct's contents as serialisable
|
/// Trait allowing to iterate a struct's contents as serialisable
|
||||||
|
|
@ -419,7 +416,6 @@ pub fn transform<T: FromXml, F: AsXml>(from: F) -> Result<T, self::error::Error>
|
||||||
/// function will return the element unharmed if its element header does not
|
/// function will return the element unharmed if its element header does not
|
||||||
/// match the expectations of `T`.
|
/// match the expectations of `T`.
|
||||||
#[cfg(feature = "minidom")]
|
#[cfg(feature = "minidom")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "minidom")))]
|
|
||||||
pub fn try_from_element<T: FromXml>(
|
pub fn try_from_element<T: FromXml>(
|
||||||
from: minidom::Element,
|
from: minidom::Element,
|
||||||
) -> Result<T, self::error::FromElementError> {
|
) -> Result<T, self::error::FromElementError> {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ macro_rules! convert_via_fromstr_and_display {
|
||||||
$(
|
$(
|
||||||
$(
|
$(
|
||||||
#[cfg $cfg]
|
#[cfg $cfg]
|
||||||
#[cfg_attr(docsrs, doc(cfg $cfg))]
|
|
||||||
)?
|
)?
|
||||||
impl FromXmlText for $t {
|
impl FromXmlText for $t {
|
||||||
#[doc = concat!("Parse [`", stringify!($t), "`] from XML text via [`FromStr`][`core::str::FromStr`].")]
|
#[doc = concat!("Parse [`", stringify!($t), "`] from XML text via [`FromStr`][`core::str::FromStr`].")]
|
||||||
|
|
@ -31,7 +30,6 @@ macro_rules! convert_via_fromstr_and_display {
|
||||||
|
|
||||||
$(
|
$(
|
||||||
#[cfg $cfg]
|
#[cfg $cfg]
|
||||||
#[cfg_attr(docsrs, doc(cfg $cfg))]
|
|
||||||
)?
|
)?
|
||||||
impl AsXmlText for $t {
|
impl AsXmlText for $t {
|
||||||
#[doc = concat!("Convert [`", stringify!($t), "`] to XML text via [`Display`][`core::fmt::Display`].\n\nThis implementation never fails.")]
|
#[doc = concat!("Convert [`", stringify!($t), "`] to XML text via [`Display`][`core::fmt::Display`].\n\nThis implementation never fails.")]
|
||||||
|
|
@ -288,11 +286,9 @@ impl TextFilter for StripWhitespace {
|
||||||
/// of incoming text data. Most interestingly, passing [`StripWhitespace`]
|
/// of incoming text data. Most interestingly, passing [`StripWhitespace`]
|
||||||
/// will make the implementation ignore any whitespace within the text.
|
/// will make the implementation ignore any whitespace within the text.
|
||||||
#[cfg(feature = "base64")]
|
#[cfg(feature = "base64")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "base64")))]
|
|
||||||
pub struct Base64;
|
pub struct Base64;
|
||||||
|
|
||||||
#[cfg(feature = "base64")]
|
#[cfg(feature = "base64")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "base64")))]
|
|
||||||
impl TextCodec<Vec<u8>> for Base64 {
|
impl TextCodec<Vec<u8>> for Base64 {
|
||||||
fn decode(&self, s: String) -> Result<Vec<u8>, Error> {
|
fn decode(&self, s: String) -> Result<Vec<u8>, Error> {
|
||||||
StandardBase64Engine
|
StandardBase64Engine
|
||||||
|
|
@ -306,7 +302,6 @@ impl TextCodec<Vec<u8>> for Base64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "base64")]
|
#[cfg(feature = "base64")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "base64")))]
|
|
||||||
impl<'x> TextCodec<Cow<'x, [u8]>> for Base64 {
|
impl<'x> TextCodec<Cow<'x, [u8]>> for Base64 {
|
||||||
fn decode(&self, s: String) -> Result<Cow<'x, [u8]>, Error> {
|
fn decode(&self, s: String) -> Result<Cow<'x, [u8]>, Error> {
|
||||||
StandardBase64Engine
|
StandardBase64Engine
|
||||||
|
|
@ -321,7 +316,6 @@ impl<'x> TextCodec<Cow<'x, [u8]>> for Base64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "base64")]
|
#[cfg(feature = "base64")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "base64")))]
|
|
||||||
impl<T> TextCodec<Option<T>> for Base64
|
impl<T> TextCodec<Option<T>> for Base64
|
||||||
where
|
where
|
||||||
Base64: TextCodec<T>,
|
Base64: TextCodec<T>,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue