Skip to content

mackwic/to_string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to_string

See the Documentation.

Pairs well with the colored crate.

use to_string::*;
assert_eq!("0b1111000", 120.to_bin());
assert_eq!("0xcafe", 51966.to_hexa());
assert_eq!("0xdeadbeef", (-559038737).to_hexa());
assert_eq!("0o1747", 999.to_octal_string());
assert_eq!("4.21e1", (42.1).to_exp());

Provided methods:

  • to_bin() / to_binary_string()
  • to_hexa() / to_hexa_string()
  • to_octal() / to_octal_string()
  • to_exp() / to_exp_string()
  • to_pointer() / to_pointer_string()
  • to_debug() / to_debug_string()

How to use

Add this in your Cargo.toml:

[dependencies]
to_string = "0.1"

and add this to your lib.rs or main.rs:

    extern crate to_string;
    use to_string::*;

About

Rust: make those primitives into strings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages