From bb25ed3327e4a4afadce76a9f1c6bd673a639726 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 26 Apr 2018 09:37:36 +0200 Subject: [PATCH] guard doctest Signed-off-by: Igor Gnatenko --- ...hexdigest-doctest-by-cfg-feature-std.patch | 25 +++++++++++++++++++ rust-sha1.spec | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 0001-guard-hexdigest-doctest-by-cfg-feature-std.patch diff --git a/0001-guard-hexdigest-doctest-by-cfg-feature-std.patch b/0001-guard-hexdigest-doctest-by-cfg-feature-std.patch new file mode 100644 index 0000000..9bb59e3 --- /dev/null +++ b/0001-guard-hexdigest-doctest-by-cfg-feature-std.patch @@ -0,0 +1,25 @@ +From 27c7f771d43fdab5a54af6bad190830262d12474 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Thu, 26 Apr 2018 09:35:50 +0200 +Subject: [PATCH] guard hexdigest() doctest by cfg(feature=std) + +Fixes: https://github.com/mitsuhiko/rust-sha1/issues/34 +--- + src/lib.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/lib.rs b/src/lib.rs +index 446c98b..a83e1e6 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -26,6 +26,7 @@ + //! ``` + //! extern crate sha1; + //! # fn main() { ++//! #[cfg(feature="std")] + //! assert_eq!(sha1::Sha1::from("Hello World!").hexdigest(), + //! "2ef7bde608ce5404e97d5f042f95f89f1c232871"); + //! # } +-- +2.17.0 + diff --git a/rust-sha1.spec b/rust-sha1.spec index ab2962e..01dc8d8 100644 --- a/rust-sha1.spec +++ b/rust-sha1.spec @@ -12,6 +12,8 @@ Summary: Minimal implementation of SHA1 for Rust License: BSD URL: https://crates.io/crates/sha1 Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +# https://github.com/mitsuhiko/rust-sha1/pull/35 +Patch0001: 0001-guard-hexdigest-doctest-by-cfg-feature-std.patch ExclusiveArch: %{rust_arches}