Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block-padding+inout: remove std feature #1117

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
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: 0 additions & 7 deletions block-padding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,3 @@ readme = "README.md"

[dependencies]
hybrid-array = "0.2.0-rc.10"

[features]
std = []

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
8 changes: 1 addition & 7 deletions block-padding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs, rust_2018_idioms)]

#[cfg(feature = "std")]
extern crate std;

pub use hybrid_array as array;

use core::fmt;
Expand Down Expand Up @@ -399,6 +395,4 @@ impl fmt::Display for UnpadError {
}
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl std::error::Error for UnpadError {}
impl core::error::Error for UnpadError {}
7 changes: 0 additions & 7 deletions inout/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,3 @@ readme = "README.md"
[dependencies]
block-padding = { version = "0.4.0-rc.0", path = "../block-padding", optional = true }
hybrid-array = "0.2.0-rc.10"

[features]
std = ["block-padding/std"]

[package.metadata.docs.rs]
all-features = true
Comment on lines -21 to -22
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we still need the all-features = true here because of the block-padding feature.

I think --cfg docsrs might be set automatically now though?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think --cfg docsrs might be set automatically now though?

It would be great, if true. We should eventually remove it from other crates then.

rustdoc-args = ["--cfg", "docsrs"]
16 changes: 4 additions & 12 deletions inout/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ impl fmt::Display for IntoArrayError {
}
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl std::error::Error for IntoArrayError {}
impl core::error::Error for IntoArrayError {}

/// The error returned when input and output slices have different length
/// and thus can not be converted to `InOutBuf`.
Expand All @@ -25,9 +23,7 @@ impl fmt::Display for NotEqualError {
}
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl std::error::Error for NotEqualError {}
impl core::error::Error for NotEqualError {}

/// Padding error. Usually emitted when size of output buffer is insufficient.
#[cfg(feature = "block-padding")]
Expand All @@ -43,9 +39,7 @@ impl fmt::Display for PadError {
}

#[cfg(feature = "block-padding")]
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl std::error::Error for PadError {}
impl core::error::Error for PadError {}

/// Output buffer is smaller than input buffer.
#[derive(Clone, Copy, Debug)]
Expand All @@ -57,6 +51,4 @@ impl fmt::Display for OutIsTooSmallError {
}
}

#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl std::error::Error for OutIsTooSmallError {}
impl core::error::Error for OutIsTooSmallError {}
3 changes: 0 additions & 3 deletions inout/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs, rust_2018_idioms)]

#[cfg(feature = "std")]
extern crate std;

#[cfg(feature = "block-padding")]
#[cfg_attr(docsrs, doc(cfg(feature = "block-padding")))]
pub use block_padding;
Expand Down