#chars #vec #vector #onigiri

onigiri

This crate is a tool of handling chars

16 releases

✓ Uses Rust 2018 edition

new 0.1.15 Jul 11, 2019
0.1.13 Apr 8, 2019
0.1.12 Feb 25, 2019
0.1.11 Dec 25, 2018
0.1.9 Nov 5, 2018

#95 in Data structures

Download history 17/week @ 2019-03-28 26/week @ 2019-04-04 9/week @ 2019-04-11 19/week @ 2019-04-25 3/week @ 2019-05-02 28/week @ 2019-05-09 15/week @ 2019-05-16 34/week @ 2019-05-23 40/week @ 2019-05-30 57/week @ 2019-06-06 5/week @ 2019-06-13 50/week @ 2019-06-20 75/week @ 2019-06-27 102/week @ 2019-07-04

145 downloads per month

MIT license

30KB
205 lines

onigiri

Build Status

onigiri

onigiri is the tool of handling chars in Rust. The japanese name of rice ball is "Onigiri". In my image, a grain of rice is char. And what collected them is chars.

July 11 2019

Add

  • validator::starts_with
  • validator::ends_with
June 2 2019

Add

  • tools::strcmp
  • Vvc method find
April 8 2019

Add

  • validator::is_lower_ascii
  • validator::is_upper_ascii
  • validator::is_title
Feb 25 2019

Removed tools::create_vvchar.

Renamed validator::is_symbol -> validator::is_punctuation

Modified DocComment and DocTest.

Usage

You add onigiri in Cargo.toml.

[dependencies]
onigiri = "0.1.15"

example is as follows.

use onigiri::tools::{Vvc, cast};
use onigiri::validator;

fn main() {
    let test_text = "(13 + 2)".to_string();
    
    let new_vvchar = Vvc::new(&test_text, ' ');
    assert_eq!(
        &new_vvchar,
        &vec![vec!['(', '1','3'],vec!['+'],vec!['2', ')']]
    );
    
    let thirteen = &new_vvchar[0][1..].to_vec();
    assert_eq!(validator::is_positive_integer(&thirteen), true);
   
    let num = cast::<u8>(&thirteen);
    assert_eq!(&num, &Some(13_u8));
    assert_eq!(&num.unwrap() + 2, 15_u8);
}

No runtime deps