[][src]Function rustils::parse::ushort::str_to_u16

pub fn str_to_u16(a: &str) -> u16

Parse &str to u16

Panics

rustils::parse::ushort::str_to_u16("-1");
rustils::parse::ushort::str_to_u16("65536");

Arguments

Examples

use rustils::parse::ushort::str_to_u16;

assert_eq!(str_to_u16("0"), 0_u16);
assert_eq!(str_to_u16("65535"), 65535_u16);