#string #from-string #owns

from-string

A crate that provides a FromString trait with a String to String noop

1 stable release

1.0.0 Mar 23, 2025

#1502 in #string

Download history 89/week @ 2025-03-19 23/week @ 2025-03-26

112 downloads per month

Apache-2.0

7KB

A crate that provides a FromString trait that works similar to FromStr but operates on owned strings. It's implemented for all types that implement FromStr with compatible errors and it has a fast-path for the no-op string to string conversion.

For convenience reasons it is constrained to conversions that return a Box<dyn Error + Send + Sync>.

use from_string::from_string;

let s: String = from_string("Hello World!").unwrap();
let i: u64 = from_string("42").unwrap();

from-string

A crate that provides a FromString trait that works similar to FromStr but operates on owned strings. It's implemented for all types that implement FromStr with compatible errors and it has a fast-path for the no-op string to string conversion.

For convenience reasons it is constrained to conversions that return a Box<dyn Error + Send + Sync>.

use from_string::from_string;

let s: String = from_string("Hello World!").unwrap();
let i: u64 = from_string("42").unwrap();

No runtime deps