Function std::iter::once

Overview
fn once(value: any) -> Once

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]);