Re: Rust kernel policy

From: Linus Torvalds
Date: Sat Feb 22 2025 - 13:45:47 EST


On Sat, 22 Feb 2025 at 09:53, Kent Overstreet <kent.overstreet@xxxxxxxxx> wrote:
>
> Because it sounds like coming up with a different way to write range
> checks is going to be easier than coming up with pattern matching magic.

Sure. But honestly, forcing humans to write non-obvious code is almost
always the exact wrong answer.

When the basic pattern is an obvious and legible one:

if (a < X || a > Y)

saying " use a different helper pattern for this" is the WRONG
SOLUTION. You're making the source code worse.

Make the tools better. Don't make humans jump through hoops because
the tools are spouting garbage.

Linus