mandober / rust-maybe-type

Rust: Option's doppelganger, the Maybe type

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maybe

  • lang: Rust
  • date: 2017-12-11
  • type: exercise
  • desc: Option's doppelganger, the Maybe type (just for exercise)

Implementation of the Maybe type, exactly the same thing as the Option, purely as get-intimate-with-impl-details sort of exercise. Heavily commented.

pub enum Maybe<T> {
    Just(T),
    Nothing
}

Source code of Option in libcore.

About

Rust: Option's doppelganger, the Maybe type


Languages

Language:Rust 100.0%