Skip to content

Commit

Permalink
Add file Readme to sample winterval_trivial_sample, update sample…
Browse files Browse the repository at this point in the history
… code
  • Loading branch information
dmvict committed Jun 9, 2022
1 parent 9acd26f commit c88dd06
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
4 changes: 4 additions & 0 deletions sample/rust/winterval_trivial_sample/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ version = "0.0.0"
edition = "2021"
publish = false

[features]
use_std = []
default = [ "use_std" ]

[dependencies]
winterval = { version = "*", path = "../../../module/rust/winterval" }
5 changes: 5 additions & 0 deletions sample/rust/winterval_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%2Fwinterval_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/winterval)
18 changes: 8 additions & 10 deletions sample/rust/winterval_trivial_sample/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#[ cfg( feature = "use_std" ) ]
use winterval::*;

fn main()
{

let src = 2..5;
#[ cfg( feature = "use_std" ) ]
assert_eq!( src.closed(), ( 2, 4 ) );
assert_eq!( src.contains( &3 ), true );
{
use winterval::*;

let src = 2..=4;
#[ cfg( feature = "use_std" ) ]
assert_eq!( src.closed(), ( 2, 4 ) );
assert_eq!( src.contains( &3 ), true );
let src = 2..5;
assert_eq!( src.closed(), ( 2, 4 ) );

let src = 2..=4;
assert_eq!( src.closed(), ( 2, 4 ) );
}
}

0 comments on commit c88dd06

Please sign in to comment.