1 unstable release

Uses old Rust 2015

0.0.1 Jan 7, 2016

#17 in #ascii-string

Download history 14/week @ 2023-11-19 18/week @ 2023-11-26 5/week @ 2023-12-03 1/week @ 2023-12-10 15/week @ 2023-12-17 10/week @ 2024-01-07 7/week @ 2024-01-14 1/week @ 2024-01-21 4/week @ 2024-01-28 2/week @ 2024-02-04 11/week @ 2024-02-11 32/week @ 2024-02-18 35/week @ 2024-02-25 23/week @ 2024-03-03

101 downloads per month
Used in 3 crates (2 directly)

MIT license

13KB
266 lines

from-ascii Build Status

This crate provides two traits: FromAscii which creates instances from ascii string (&[u8]) and FromAsciiRadix wich creates only integral values with given radix.

The documentation is located at http://knsd.github.io/from-ascii/.

Usage example:


extern crate from_ascii;

use from_ascii::{FromAscii, FromAsciiRadix};

fn main() {
    println!("{:?}", f64::from_ascii(b"123.456"));
    println!("{:?}", i16::from_ascii_radix(b"FF", 16));
}


lib.rs:

This crate provides two traits: FromAscii which creates instances from ascii string (&[u8]) and FromAsciiRadix wich creates only integral values with given radix.

Usage example:

extern crate from_ascii;

use from_ascii::{FromAscii, FromAsciiRadix};


fn main() {
    println!("{:?}", f64::from_ascii(b"123.456"));
    println!("{:?}", i16::from_ascii_radix(b"FF", 16));
}

No runtime deps