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

Add "length" as doc alias to len methods #80430

Merged
merged 1 commit into from
Dec 29, 2020

Conversation

KamilaBorowska
Copy link
Contributor

Currently when searching for length there are no results: https://doc.rust-lang.org/std/?search=length. This makes len methods appear when searching for length.

@rust-highfive
Copy link
Collaborator

r? @withoutboats

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 28, 2020
@@ -1388,6 +1388,7 @@ impl String {
/// assert_eq!(fancy_f.len(), 4);
/// assert_eq!(fancy_f.chars().count(), 3);
/// ```
#[doc(alias = "length")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think an additional bytes_len would be good here since it reflects that? I am not sure if anyone would type that out, if we put it it may be hidden.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rust documentation system doesn't render aliases unless you are directly searching for them, and I don't think anyone would type bytes_len specifically.

@steveklabnik
Copy link
Member

Thank you!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Dec 28, 2020

📌 Commit 9e77998 has been approved by steveklabnik

@bors bors 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 Dec 28, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#80383 (clarify wrapping ptr arithmetic docs)
 - rust-lang#80390 (BTreeMap: rename the area access methods)
 - rust-lang#80393 (Add links to the source for the rustc and rustdoc books.)
 - rust-lang#80398 (Use raw version of align_of in rc data_offset)
 - rust-lang#80402 (Document `InferTy` & co.)
 - rust-lang#80403 (fix: small typo error in chalk/mod.rs)
 - rust-lang#80410 (rustdoc book: fix example)
 - rust-lang#80419 (Add regression test for rust-lang#80375)
 - rust-lang#80430 (Add "length" as doc alias to len methods)
 - rust-lang#80431 (Add "chr" as doc alias to char::from_u32)
 - rust-lang#80448 (Fix stabilization version of deque_range feature.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e351a3b into rust-lang:master Dec 29, 2020
@rustbot rustbot added this to the 1.51.0 milestone Dec 29, 2020
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants