Comment

Comment by kibwen

> which can be transparently converted to an Option<T> for any T, allowing for type inference to go in only one direction, while still avoiding the boilerplate of Option<T>::None

You don't need to qualify the None, the following works:

    fn foo<T>(x: T) -> Option<T> {
        None
    }
parent kibwen 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton