News for hackers. Stuff that matters.
Re:Swift is a more convenient Rust by Measter on Saturday September 07, 2024 @09:11AM (#41473748)
Bear in mind that the optimization on `Option<Infallible>` isn't specific to that type; it applies to anything that results in one possible value. For example, `Foo` in this example is also zero-sized:

    pub enum Foo {
        Foo,
        Bar(A),
        Baz(B),
        Qux(C),
    }

    pub enum A {}
    pub enum B {}
    pub enum C {}
The optimization applied to Vec also applies to any zero-sized type.

There are no comments on this comment yet.