as much as I love #rust, you can't pass parameters by name

parameters have to be in the correct special order each function wants them in

you get a lot of

do_something_that_has_options(None, None, Some(231.23), None)

which is pretty opaque. [1]

[1]: granted, this example is from an OpenAPi-automatically-generated library.

we spend all this compute on the borrow checker, maybe we can look up the order of parameters while we're at it and save us all some 💩​

Follow

@matt

You CAN kind of wing it, if you are in charge of the API, e.g:

<code>
let handle = create_window(WindowConfig {
width: 500,
z_position: 2,
autoclose: AutoclosePolicy::Enable,
..Default::default()
});
</code>

From: thecodedmessage.com/posts/defa

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.