Skip to content

Replace println! with assert! in HashMap documentation examples#156630

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
BowLuckie:main
May 18, 2026
Merged

Replace println! with assert! in HashMap documentation examples#156630
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
BowLuckie:main

Conversation

@BowLuckie
Copy link
Copy Markdown
Contributor

@BowLuckie BowLuckie commented May 16, 2026

Changes

  • .keys()
  • .values()
  • .values_mut()
  • .iter()
  • .iter_mut()

BowLuckie added 2 commits May 16, 2026 10:35
…in documentations

Updated `.keys()`, `.values()`, `.iter()` and `.iter_mut()`. 

Instead of using print statements which shows no clear effect  by just reading the documentation
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 16, 2026
`.keys()` was using `.values()` in the comment and 2 other functions were missing `use std::collections::HashMap`
@BowLuckie BowLuckie marked this pull request as ready for review May 16, 2026 01:36
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 16, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 16, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 16, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates

@rust-log-analyzer

This comment has been minimized.

at lines 495 and 558
@clarfonthey
Copy link
Copy Markdown
Contributor

Looks pretty reasonable to me.

@clarfonthey
Copy link
Copy Markdown
Contributor

r? clarfonthey

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 18, 2026

📌 Commit 3e3baaf has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2026
rust-bors Bot pushed a commit that referenced this pull request May 18, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156709 (stdarch subtree update)
 - #155006 (stabilize `feature(cfg_target_has_atomic_equal_alignment)`)
 - #156444 (Implement `OsStr::split_at`)
 - #156582 (Allow `global_asm!` in statement positions)
 - #156661 (Remove `UncheckedIterator`)
 - #152367 (Derives `Copy` for `ffi::FromBytesUntilNulError`)
 - #156443 (Fix invalid suggestion for parenthesized break)
 - #156606 (Add pext/pdep as aliases for extract_bits/deposit_bits)
 - #156630 (Replace `println!` with `assert!` in HashMap documentation examples)
 - #156644 (Widen the result of `widening_mul`.)
 - #156653 (Update `sysinfo` version to `0.39.2`)
 - #156697 (Add diagnostic items for IoBufReader and StdinLock)
 - #156704 (reduce usage of `box_patterns` in tests)
@rust-bors rust-bors Bot merged commit a26a652 into rust-lang:main May 18, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 18, 2026
rust-timer added a commit that referenced this pull request May 18, 2026
Rollup merge of #156630 - BowLuckie:main, r=clarfonthey

Replace `println!` with `assert!` in HashMap documentation examples

## Changes
- **`.keys()`**
- **`.values()`**
- **`.values_mut()`**
- **`.iter()`**
- **`.iter_mut()`**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants