Skip to content

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Nov 8, 2012

r? @nikomatsakis (last commit only)

@pcwalton
Copy link
Contributor Author

pcwalton commented Nov 8, 2012

r? @nikomatsakis for the floating point literal inference commit

@pcwalton pcwalton closed this Nov 13, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Oct 5, 2024
Prefer refutable slice patterns over len check + index op

Just something I noticed while reviewing other PRs

We do it for shim arguments almost everywhere, but when the size is not statically known, we didn't use the helpers as they rely on array ops. But we can avoid a len check followed by several index ops by just using a refutable slice pattern with `let else`.

The pattern is so common, it seems almost worth a dedicated macro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants