17 releases (breaking)
new 0.13.0 | Apr 13, 2025 |
---|---|
0.11.0 | Oct 30, 2024 |
0.9.0 | May 11, 2024 |
0.8.0 | Mar 16, 2024 |
0.0.1 | Nov 29, 2021 |
#1206 in Rust patterns
537 downloads per month
Used in 75 crates
(2 directly)
8KB
75 lines
Module :: is_slice
Macro to answer the question: is it a slice?
Basic use-case
use is_slice::*;
dbg!( is_slice!( Box::new( true ) ) );
// < is_slice!(Box :: new(true)) = false
dbg!( is_slice!( &[ 1, 2, 3 ] ) );
// < is_slice!(& [1, 2, 3]) = false
dbg!( is_slice!( &[ 1, 2, 3 ][ .. ] ) );
// < is_slice!(& [1, 2, 3] [..]) = true
To add to your project
cargo add is_slice
Try out from the repository
git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/is_slice_trivial
cargo run