Function id

Source
pub const fn id<T>(x: T) -> T
Expand description

The identity function id(x) = x also known as I (Idiot) combinator.

ยงExample

use rust2fun::prelude::*;

let actual = Some(1).map(id);
assert_eq!(Some(1), actual);