Skip to content

#16: own stack values in consuming iterator#73

Merged
yegor256 merged 1 commit into
yegor256:masterfrom
GHX5T-SOL:16-own-into-iter
May 27, 2026
Merged

#16: own stack values in consuming iterator#73
yegor256 merged 1 commit into
yegor256:masterfrom
GHX5T-SOL:16-own-into-iter

Conversation

@GHX5T-SOL
Copy link
Copy Markdown
Contributor

Fixes #16.

Summary:

  • implement IntoIterator for Stack so consuming iteration owns the fixed array
  • remove the raw pointer read loop from IntoIter::next() and copy values directly by index
  • update the iterator regression to verify ordered collected values

Validation:

  • cargo test --all-features -> 23 unit tests and 2 doctests passed on current master before this patch, confirming Baseline build is red on master: #[must_use] on trait-impl methods and elided-lifetime warnings now errors under stable rustc #70 no longer reproduces locally with rustc 1.94.1.
  • cargo --color=never fmt --check -> passed
  • cargo --color=never test --all-features -> 23 unit tests and 2 doctests passed
  • cargo --color=never test --release --all-features -> 23 unit tests and 2 doctests passed
  • cargo --color=never doc --no-deps -> passed
  • git diff --check -> passed
  • git diff | gitleaks stdin --redact --no-banner --exit-code 1 -> no leaks found

Not run locally:

  • cargo clippy: this environment does not have the Cargo clippy subcommand installed.
  • rustup run nightly cargo bench: rustup is not installed here, so the official nightly benchmark command could not be run locally.

@yegor256 yegor256 merged commit b58e960 into yegor256:master May 27, 2026
3 checks passed
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.

Stack::into_iter() is slower than Vec::into_iter()

2 participants