2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2012-08-02 23:01:38 +00:00
|
|
|
// aux-build:static-methods-crate.rs
|
|
|
|
|
2014-02-14 18:10:06 +00:00
|
|
|
extern crate static_methods_crate;
|
2013-05-25 02:35:29 +00:00
|
|
|
|
2012-09-05 19:32:05 +00:00
|
|
|
use static_methods_crate::read;
|
2012-08-02 23:01:38 +00:00
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2015-03-26 00:06:52 +00:00
|
|
|
let result: isize = read("5".to_string());
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(result, 5);
|
2014-05-25 10:17:19 +00:00
|
|
|
assert_eq!(read::readMaybe("false".to_string()), Some(false));
|
|
|
|
assert_eq!(read::readMaybe("foo".to_string()), None::<bool>);
|
2012-08-02 23:01:38 +00:00
|
|
|
}
|