15 releases (breaking)

new 0.11.0 Oct 30, 2024
0.9.0 May 11, 2024
0.8.0 Mar 16, 2024
0.4.0 Oct 28, 2023
0.0.1 Nov 29, 2021

#2460 in Development tools

Download history 163/week @ 2024-07-10 271/week @ 2024-07-17 251/week @ 2024-07-24 198/week @ 2024-07-31 194/week @ 2024-08-07 186/week @ 2024-08-14 155/week @ 2024-08-21 168/week @ 2024-08-28 141/week @ 2024-09-04 392/week @ 2024-09-11 250/week @ 2024-09-18 230/week @ 2024-09-25 156/week @ 2024-10-02 150/week @ 2024-10-09 198/week @ 2024-10-16 138/week @ 2024-10-23

653 downloads per month
Used in 76 crates (via typing_tools)

MIT license

8KB
75 lines

Module :: is_slice

experimental rust-status docs.rs Open in Gitpod discord

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

No runtime deps

Features