News for hackers. Stuff that matters.
Re:Single Page Applications using Rust by setr on Tuesday August 11, 2020 @05:33PM (#24126242)
To be clear, you're talking about the function signature changing from

    fn(a: int)
to

    fn(a: Option<int>)
?

Technically, yes, all callers would have to update, but practically, you'd just define

    fn(a: int) { fn_2(Some(a)) }
to avoid the breakage. That is, you're essentially telling the compiler how to loosen the requirements. Ergonomically, this seems rather fine. Especially if this means you gain (some) protections from the much more problematic case of restricting the requirements.
Re:Single Page Applications using Rust by mqus on Tuesday August 11, 2020 @07:52PM (#24127285)
There is also the Option of accepting Into<Option<T>>, which does cover both variants and is completely backwards compatible.