Function ::std::iter::once

Overview
fn once(value) -> Iterator

Construct an iterator which produces a single value once.

Examples

use std::iter::once;

assert!(once(42).next().is_some());
assert_eq!(once(42).collect::<Vec>(), [42]);