Function std::iter::empty1.2.0 (const: 1.32.0)[][src]

pub const fn empty<T>() -> Empty<T>
Notable traits for Empty<T>
impl<T> Iterator for Empty<T> type Item = T;
Expand description

创建一个不产生任何结果的迭代器。

Examples

基本用法:

use std::iter;

// 这可能是 i32 上的迭代器,但是,事实并非如此。
let mut nope = iter::empty::<i32>();

assert_eq!(None, nope.next());
Run