Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSLX:tests] Add sample showing std::find_index on enum array. #1931

Conversation

cdleary
Copy link
Collaborator

@cdleary cdleary commented Feb 14, 2025

Demonstrates how we can use std::find_index if we map over the enum array to convert into the underlying type first, since we can't currently (with TIv1) write a stdlib routine that's parameterized over both enum types and bit values.

Copy link
Collaborator

@grebe grebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if this was still WiP (this is a draft CL), but thought I'd review ASAP

// See the License for the specific language governing permissions and
// limitations under the License.

//! Validates that we can find the index of a value in an enum array.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is //! for some reason I'm unaware of?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For rustdoc this means "it's a comment block associated with the module it's enclosed in" -- we don't have a dslxdoc yet but I hope to fix that one day so just trying to stick to what we'd tend to do in Rust where possible.

@cdleary cdleary marked this pull request as ready for review February 14, 2025 21:40
@cdleary
Copy link
Collaborator Author

cdleary commented Feb 14, 2025

Sorry if this was still WiP (this is a draft CL), but thought I'd review ASAP

No worries I usually just post it in draft form to make sure CI passes before I hit the "ready" button.

@copybara-service copybara-service bot merged commit 3b9939d into google:main Feb 15, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants