stdlib: Add map* for Option and Result

This commit is contained in:
2025-05-05 05:32:23 -04:00
parent c5e817f1e5
commit dc1c9bdd6d
2 changed files with 21 additions and 0 deletions

View File

@@ -19,4 +19,11 @@ impl Option {
None => true,
}
}
/// Maps from one option space to another
// pub fn map<U>(self: Self, f: fn(T) -> U) -> Option<U> {
// match self {
// Some(value) => Some(f(value)),
// None => None,
// }
// }
}