Skip to content

Commit 5a08162

Browse files
authored
Rollup merge of #80431 - xfix:add-chr-as-doc-alias, r=steveklabnik
Add "chr" as doc alias to char::from_u32 Many programming languages provide a function called `chr` - Perl, Python, PHP, Visual Basic, SQL. This change makes `char::from_u32` easier to discover in the documentation. `ord` is not added as its name conflicts with `Ord` trait, and it's not exactly clear what it could point to (`<u32 as From<char>>::from`?). I don't think it's exactly necessary, as `char::from_u32` documentation page says you can do reverse conversion with `as` operator anyway.
2 parents e351a3b + b3be9e1 commit 5a08162

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/char/convert.rs

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ use super::MAX;
4747
///
4848
/// assert_eq!(None, c);
4949
/// ```
50+
#[doc(alias = "chr")]
5051
#[inline]
5152
#[stable(feature = "rust1", since = "1.0.0")]
5253
pub fn from_u32(i: u32) -> Option<char> {

0 commit comments

Comments
 (0)