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