Skip to content

Latest commit

 

History

History

is_slice

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

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