Skip to content

Commit

Permalink
Add file Readme to sample implements_trivial_sample
Browse files Browse the repository at this point in the history
  • Loading branch information
dmvict committed Jun 9, 2022
1 parent 717cb64 commit 86841ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
17 changes: 6 additions & 11 deletions module/rust/is_slice/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ Macro to answer the question: is it a slice?
```rust
use is_slice::*;

fn main()
{

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

}
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
Expand Down
5 changes: 5 additions & 0 deletions sample/rust/implements_trivial_sample/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Sample

[![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
[![Open in Gitpod](https://raster.shields.io/static/v1?label=try&message=online&color=eee&logo=gitpod&logoColor=eee)](https://gitpod.io/#RUN_PATH=sample%2Frust%2Fimplements_trivial_sample,SAMPLE_FILE=.%2Fsrc%2Fmain.rs/https://github.com/Wandalen/wTools)
[![docs.rs](https://raster.shields.io/static/v1?label=docs&message=online&color=eee&logo=docsdotrs&logoColor=eee)](https://docs.rs/implements)
2 changes: 0 additions & 2 deletions sample/rust/implements_trivial_sample/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ pub use implements::*;

fn main()
{

dbg!( implements!( 13_i32 => Copy ) );
// < implements!( 13_i32 => Copy ) : true
dbg!( implements!( Box::new( 13_i32 ) => Copy ) );
// < implements!( 13_i32 => Copy ) : false

}

0 comments on commit 86841ec

Please sign in to comment.