is_slice

Crates.iois_slice
lib.rsis_slice
version0.9.0
sourcesrc
created_at2021-11-29 19:36:42.872791
updated_at2024-05-11 22:36:00.647058
descriptionMacro to answer the question: is it a slice?
homepagehttps://github.com/Wandalen/wTools/tree/master/module/core/is_slice
repositoryhttps://github.com/Wandalen/wTools/tree/master/module/core/is_slice
max_upload_size
id489463
size29,464
Wandalen (Wandalen)

documentation

https://docs.rs/is_slice

README

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
Commit count: 0

cargo fmt