如在此存储库中所见:
https://github.com/ReactiveX/RxRust/blob/master/src/lib.rs#L110
let gen = move |:| {
let it = range(0is, 20is);
// ~~~ ~~~~
let q = Box::new(Decoupler::new(dtx.clone()));
let mut map1 = Box::new(Map::new(|i : isize| {i * 10}));
let mut map2 = Box::new(Map::new(|i : isize| {i + 2}));
let mut iter = Box::new(IterPublisher::new(it));
map2.subscribe(q);
map1.subscribe(map2);
iter.subscribe(map1);
};
(波浪形地强调我的)
我试图弄清楚数字is
后面是什么。该书仅简要介绍了文字后缀:
请注意,除了字节文字之外的所有数字文字都允许使用类型后缀,例如 57u8,并使用 _ 作为可视分隔符,例如 1_000。
— https://doc.rust-lang.org/book/ch03-02-data-types.html#integer-types
并且编译器(1.53)只理解一组特定的后缀,所以我什至无法在我的机器上构建原始的 crate:
invalid suffix `is`
help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)
是某种古老的语法,还是我遗漏了什么?