Hacker News new | ask | show | jobs
by nicoburns 1702 days ago
It's a lot of small papercuts, but

    use module::{ foo, Parameters, ParametersWithDefault };

    fn bar() {
        foo(Parameters {
           non_optional_parameter_1: Foo,
           non_optional_parameter_2: Bar,
           extra_options: ParametersWithDefault {
               optional_param: Baz,
               ...Default::default(),
           }
        });
    }
is a far cry in ergonomics from:

    use module::foo;

    fn bar() {
        foo(_ {
            non_optional_parameter_1: Foo,
            non_optional_parameter_2: Bar,
            optional_param: Baz,
            ..
        });
    }
Even just having to import the extra structs (and lookup the names) is a massive pain. Especially if you need to change to use a slightly different function.