-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@@ -1388,6 +1388,7 @@ impl String { | |||
/// assert_eq!(fancy_f.len(), 4); | |||
/// assert_eq!(fancy_f.chars().count(), 3); | |||
/// ``` | |||
#[doc(alias = "length")] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Thank you! @bors: r+ rollup |
📌 Commit 9e77998 has been approved by |
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
Currently when searching for
length
there are no results: https://doc.rust-lang.org/std/?search=length. This makeslen
methods appear when searching forlength
.