chiark / gitweb /
Elide 'foo: foo' in struct literals where possible.
authorSimon Tatham <anakin@pobox.com>
Mon, 1 Jan 2024 13:51:45 +0000 (13:51 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 1 Jan 2024 13:51:45 +0000 (13:51 +0000)
commit59138a8e89e5a4f593ebfefef8510a8ed7c80b57
tree95a8a71636e97acf0a89f4722312a6206938c65d
parent04530126b126701ac69efca3111d57ff3be5286a
Elide 'foo: foo' in struct literals where possible.

Another thing I only just realised: although in general you're
supposed to explicitly say the name of each field you're initialising,
there's a special case where you can leave it out if the name of the
local variable you're initialising it _to_ is exactly the same.
Presumably on the grounds that that still doesn't allow much
confusion, and is terser.
src/client.rs
src/coloured_string.rs
src/config.rs
src/editor.rs
src/file.rs
src/text.rs
src/tui.rs