summaryrefslogtreecommitdiff
path: root/src/rust/crypto/lib.rs
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2018-06-18 13:41:38 -0500
committerTaylor Yu <catalyst@torproject.org>2018-06-19 13:53:26 -0500
commitbfd36177c46e3348989c55bdfdacf5e694b4766b (patch)
treec47800babaa0333c33f07054e350357740425dde /src/rust/crypto/lib.rs
parentd27745d81de8829d1a6da851fe9be057458e86df (diff)
downloadtor-bfd36177c46e3348989c55bdfdacf5e694b4766b.tar.gz
tor-bfd36177c46e3348989c55bdfdacf5e694b4766b.zip
Fix compilation of Rust crypto doctests
The doctests for src/rust/crypto don't compile for multiple reasons, including some missing exports and incorrect identifier paths. Fixes bug 26415; bugfix on 0.3.4.1-alpha.
Diffstat (limited to 'src/rust/crypto/lib.rs')
-rw-r--r--src/rust/crypto/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rust/crypto/lib.rs b/src/rust/crypto/lib.rs
index b4250dec34..d120635b95 100644
--- a/src/rust/crypto/lib.rs
+++ b/src/rust/crypto/lib.rs
@@ -10,18 +10,18 @@
//! and extendable output functions.
//!
//! ```
-//! use crypto::digests::sha256::Sha256;
+//! use crypto::digests::sha2::*;
//!
-//! let hasher: Sha256 = Sha256::default();
+//! let mut hasher: Sha256 = Sha256::default();
//! let mut result: [u8; 32] = [0u8; 32];
//!
-//! hasher.input("foo");
-//! hasher.input("bar");
-//! hasher.input("baz");
+//! hasher.input(b"foo");
+//! hasher.input(b"bar");
+//! hasher.input(b"baz");
//!
-//! result.copy_from_slice(hasher.result().as_bytes());
+//! result.copy_from_slice(hasher.result().as_slice());
//!
-//! assert!(result == "XXX");
+//! assert!(result == [b'X'; DIGEST256_LEN]);
//! ```
#[deny(missing_docs)]