Shorthand for `Default::default()`

I doubt this would get anything as short as just ~.

Maybe this could be in the prelude

use std::default::Default::default;

(once that's possible).

Then it'd be

foo(v, default(), default(), 10);

which seems tolerable.

Of course, what I'd really want there is

because once you have two "I don't care just do whatever" parameters you'll probably have more soon, so the best thing is to make it foo(v, .{ width: 10, .. }) instead of spamming in lots of ~, ~, ~, ~.

5 Likes