summaryrefslogtreecommitdiff
path: root/improved_slice_patterns/src/lib.rs
diff options
context:
space:
mode:
authorNadrieril2019-04-14 23:26:03 +0200
committerNadrieril2019-04-14 23:26:45 +0200
commitee3f9d270bcdbb06ad11daa61667c694196d46f8 (patch)
treeac71f98cb2f2c90cc6eca1480b62c1efe698e519 /improved_slice_patterns/src/lib.rs
parent74e59290247a7201c17dd748b7f554716ad16691 (diff)
improved_slice_patterns: various tweaks for crates.io
Diffstat (limited to '')
-rw-r--r--improved_slice_patterns/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/improved_slice_patterns/src/lib.rs b/improved_slice_patterns/src/lib.rs
index 3fdd9c9..3e459bb 100644
--- a/improved_slice_patterns/src/lib.rs
+++ b/improved_slice_patterns/src/lib.rs
@@ -1,4 +1,5 @@
#![feature(slice_patterns)]
+#![doc(html_root_url = "https://docs.rs/improved_slice_patterns/1.0.1")]
//! A tiny crate that provides two macros to help matching
//! on `Vec`s and iterators using the syntax of
@@ -7,10 +8,13 @@
//! [slice_patterns]: https://doc.rust-lang.org/nightly/unstable-book/language-features/slice-patterns.html
/// Destructure an iterator using the syntax of slice_patterns.
+///
/// Wraps the match body in `Some` if there was a match; returns
/// `None` otherwise.
+///
/// Contrary to slice_patterns, this allows moving out
/// of the iterator.
+///
/// A variable length pattern (`x..`) is only allowed as the last
/// pattern, unless the iterator is double-ended.
///
@@ -122,10 +126,13 @@ macro_rules! destructure_iter {
}
/// Pattern-match on a vec using the syntax of slice_patterns.
+///
/// Wraps the match body in `Some` if there was a match; returns
/// `None` otherwise.
+///
/// Contrary to slice_patterns, this allows moving out
/// of the `Vec`.
+///
/// A variable length pattern (`x..`) returns an iterator.
///
/// Example: