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

feat(data_structures): add first and first_mut methods to stack types #8908

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Feb 5, 2025

Add first and first_mut methods to NonEmptyStack and SparseStack.

  • For NonEmptyStack, these methods for can be infallible, as the stack is guaranteed not to be empty.
  • For SparseStack, these methods can use the more efficient methods on NonEmptyStack.

Originally suggested by @branchseer in #8691.

Copy link
Contributor Author

overlookmotel commented Feb 5, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-enhancement Category - New feature or request labels Feb 5, 2025
@overlookmotel overlookmotel marked this pull request as ready for review February 5, 2025 12:49
Copy link

codspeed-hq bot commented Feb 5, 2025

CodSpeed Performance Report

Merging #8908 will not alter performance

Comparing 02-05-feat_data_structures_add_first_and_first_mut_methods_to_stack_types (0a74cf5) with main (f6b6e70)

Summary

✅ 33 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as draft February 5, 2025 13:05
@overlookmotel overlookmotel force-pushed the 02-05-feat_data_structures_add_first_and_first_mut_methods_to_stack_types branch from ee91832 to 3b650c0 Compare February 5, 2025 13:31
@overlookmotel overlookmotel marked this pull request as ready for review February 5, 2025 13:31
@overlookmotel overlookmotel changed the base branch from 02-05-docs_data_structures_correct_doc_comments_for_sparsestack_ to graphite-base/8908 February 5, 2025 13:32
@overlookmotel overlookmotel marked this pull request as draft February 5, 2025 13:32
@overlookmotel overlookmotel force-pushed the 02-05-feat_data_structures_add_first_and_first_mut_methods_to_stack_types branch from 3b650c0 to 3168f14 Compare February 5, 2025 13:38
@overlookmotel overlookmotel changed the base branch from graphite-base/8908 to main February 5, 2025 13:39
@overlookmotel overlookmotel force-pushed the 02-05-feat_data_structures_add_first_and_first_mut_methods_to_stack_types branch 2 times, most recently from 3c19274 to 39b0c9c Compare February 5, 2025 13:58
@overlookmotel overlookmotel marked this pull request as ready for review February 5, 2025 14:02
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 5, 2025
Copy link

graphite-app bot commented Feb 5, 2025

Merge activity

…ypes (#8908)

Add `first` and `first_mut` methods to `NonEmptyStack` and `SparseStack`.

* For `NonEmptyStack`, these methods for can be infallible, as the stack is guaranteed not to be empty.
* For `SparseStack`, these methods can use the more efficient methods on `NonEmptyStack`.

Originally suggested by @branchseer in #8691.
@graphite-app graphite-app bot force-pushed the 02-05-feat_data_structures_add_first_and_first_mut_methods_to_stack_types branch from 39b0c9c to 0a74cf5 Compare February 5, 2025 16:17
@graphite-app graphite-app bot merged commit 0a74cf5 into main Feb 5, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 02-05-feat_data_structures_add_first_and_first_mut_methods_to_stack_types branch February 5, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-transformer Area - Transformer / Transpiler C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants