diff --git a/_languages/rust-struct-initializer-mistake.md b/_languages/rust-struct-initializer-mistake.md index b216dc12..57c6ace2 100644 --- a/_languages/rust-struct-initializer-mistake.md +++ b/_languages/rust-struct-initializer-mistake.md @@ -155,7 +155,7 @@ someFunction(.a = 23) ##### Option 3: Let named parameters use the "good" syntax and give variable assignments some "workaround" syntax Inside a functions argument list, the first level of `=` use is always a named parameter and never a -variable assignment, even if some variable `a` would be in scope.[^2] +variable assignment, even if some variable `a` would be in scope. ```kotlin // named parameter, and if someFunction's parameter name changes, @@ -167,7 +167,3 @@ someFunction(a = 23) // (which is generally a bad idea): someFunction(a = { a = 23 }) ``` - - -[^1]: Except the tupled version of enums, for which initializers look like function calls again. -[^2]: Also, variable assignment returns `Unit`, so we never have to decide, right? RIGHT?