Crates.io | iceyee_convert |
lib.rs | iceyee_convert |
version | 1.0.3 |
source | src |
created_at | 2022-11-09 03:29:44.375156 |
updated_at | 2023-10-29 14:56:14.361618 |
description | 类型转换, Conversion, 已被弃用, 参考iceyee_encoder. |
homepage | |
repository | https://github.com/iceyee/rust_iceyee/tree/main/iceyee_convert/ |
max_upload_size | |
id | 708512 |
size | 5,322 |
转换类型.
#[test]
pub fn test_string_to_hex() {
use iceyee_convert::Conversion;
println!("");
assert!(Conversion::string_to_hex("FFF").unwrap() == 0xFFF);
assert!(Conversion::string_to_hex("1af").unwrap() == 0x1AF);
assert!(Conversion::string_to_hex("FFFG").is_err());
assert!(Conversion::string_to_hex(" Z").is_err());
return;
}