ego

Crate Version Downloads Docs

ego provides the identity function – it takes self, and returns self unchanged. It is equivalent to the closure |x| x, except that no type coercion can take place.

It is a placeholder for the as-yet-unstabilized std::convert::identity. The name draws on “ego” as the concept of “self”, the keyword Rust uses to refer to the value of an object, and a play on “id” as a short term for “identity” and a counterpart to “ego” in Freudian psychology.

Like Freudian psychology, this crate will soon be replaced by better standard understandings of the world.