#convert #iceyee #test #string-to-hex #转换类型

iceyee_convert

类型转换, Conversion, 已弃用, 请参考iceyee_encoder

4 个稳定版本

1.0.3 2023年10月29日
1.0.2 2022年11月11日
1.0.1 2022年11月10日
1.0.0 2022年11月9日

#8#iceyee

Apache-2.0 协议

5KB
59

iceyee_convert

转换类型.

  • string_to_hex

支持的操作系统

  • linux
  • macos
  • windows

示例

#[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;
}

lib.rs:

转换类型.

无运行时依赖