zig icon indicating copy to clipboard operation
zig copied to clipboard

Typo: insure => ensure

Open bertie-wheen opened this issue 1 year ago • 3 comments

Noticed several instances of the same typo. In most other places it's correctly 'ensure', just not here.

bertie-wheen avatar Mar 23 '24 17:03 bertie-wheen

see https://github.com/ziglang/zig/pull/19181#issuecomment-1998000935

xdBronch avatar Mar 23 '24 17:03 xdBronch

Oops, reverted the wrong half of the commit. Will fix!

bertie-wheen avatar Mar 23 '24 17:03 bertie-wheen

Have squashed. The commit now only fixes typos in non-vendored code.

bertie-wheen avatar Mar 23 '24 18:03 bertie-wheen

Just some food for thought; this isn't necessarily a typo. the third definition of image and the first definition of image shows they are synonyms.

Am aware of that, but it is essentially a typo, as they're not really synonyms. Insure is nearly always used for the financial/insurance meaning, whereas ensure is more correct in these cases. Even if you want to make the argument that you can use "insure" for the "to make sure" meaning, it's very non-standard, and moreover is inconsistent with our choices everywhere else. Even excluding lib/libc*, there are ~1.5k instances of "ensure" across 200+ files, and these are the only exceptions. Particularly, there are several functions/methods that include it (e.g. ensureTotalCapacity, ensureUnusedCapacity, ...), and basically I think that - as with code style - it's better to be consistent.

bertie-wheen avatar Mar 25 '24 14:03 bertie-wheen

lib/include is also vendored.

Vexu avatar Mar 25 '24 15:03 Vexu

@Vexu I've committed a revert of the lib/include files, but there's still the main typo, which is in lib/init/build.zig.zon. Can you reopen?

bertie-wheen avatar Mar 25 '24 17:03 bertie-wheen