From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: ptr: use `match` instead of `unwrap_or_else` for `build_index` Date: Thu, 04 Jun 2026 12:43:26 +1000 Message-ID: In-Reply-To: <20260602-projection-syntax-rework-v2-2-6989470f5440@garyguo.net> References: <20260602-projection-syntax-rework-v2-0-6989470f5440@garyguo.net> <20260602-projection-syntax-rework-v2-2-6989470f5440@garyguo.net> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review Replaces `unwrap_or_else(|| build_error!())` with a `match` to avoid potential inlining issues: ```rust - Self::get(self, slice).unwrap_or_else(|| build_error!()) + match Self::get(self, slice) { + Some(v) => v, + None => build_error!(), + } ``` This is a good defensive change. `build_error!()` is a compile-time construct and relying on the closure being inlined (so the compiler can see the `build_error!` call) is fragile. The `match` makes this unconditional. Suggested by Alice Ryhl with a link to discussion. No issues. --- Generated by Claude Code Patch Reviewer