Skip to content

Commit

Permalink
Use monospaced links where applicable (#550)
Browse files Browse the repository at this point in the history
# Objective

- Follow up on
#546 (comment)

# Solution

- Use monospace links where applicable.
- I also found a reference to the old wiki which I replaced with the new
one.
  • Loading branch information
Earthcomputer authored Oct 9, 2023
1 parent 8906f88 commit d89ecad
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 144 deletions.
70 changes: 35 additions & 35 deletions crates/java_string/src/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl JavaCodePoint {
pub const REPLACEMENT_CHARACTER: JavaCodePoint =
JavaCodePoint::from_char(char::REPLACEMENT_CHARACTER);

/// See [char::from_u32]
/// See [`char::from_u32`]
///
/// ```
/// # use java_string::JavaCodePoint;
Expand Down Expand Up @@ -136,7 +136,7 @@ impl JavaCodePoint {
char::from_u32_unchecked(self.as_u32())
}

/// See [char::encode_utf16]
/// See [`char::encode_utf16`]
///
/// ```
/// # use java_string::JavaCodePoint;
Expand Down Expand Up @@ -226,7 +226,7 @@ impl JavaCodePoint {
&mut dst[..len]
}

/// See [char::eq_ignore_ascii_case].
/// See [`char::eq_ignore_ascii_case`].
#[inline]
pub fn eq_ignore_ascii_case(&self, other: &JavaCodePoint) -> bool {
match (self.as_char(), other.as_char()) {
Expand All @@ -236,7 +236,7 @@ impl JavaCodePoint {
}
}

/// See [char::escape_debug].
/// See [`char::escape_debug`].
///
/// ```
/// # use java_string::JavaCodePoint;
Expand Down Expand Up @@ -303,7 +303,7 @@ impl JavaCodePoint {
char.escape_debug().next() != Some('\\')
}

/// See [char::escape_default].
/// See [`char::escape_default`].
///
/// ```
/// # use java_string::JavaCodePoint;
Expand Down Expand Up @@ -348,7 +348,7 @@ impl JavaCodePoint {
}
}

/// See [char::escape_unicode].
/// See [`char::escape_unicode`].
///
/// ```
/// # use java_string::JavaCodePoint;
Expand Down Expand Up @@ -392,49 +392,49 @@ impl JavaCodePoint {
}
}

/// See [char::is_alphabetic].
/// See [`char::is_alphabetic`].
#[inline]
#[must_use]
pub fn is_alphabetic(self) -> bool {
self.as_char().is_some_and(|char| char.is_alphabetic())
}

/// See [char::is_alphanumeric].
/// See [`char::is_alphanumeric`].
#[inline]
#[must_use]
pub fn is_alphanumeric(self) -> bool {
self.as_char().is_some_and(|char| char.is_alphanumeric())
}

/// See [char::is_ascii].
/// See [`char::is_ascii`].
#[inline]
#[must_use]
pub fn is_ascii(self) -> bool {
self.as_u32() <= 0x7f
}

/// See [char::is_ascii_alphabetic].
/// See [`char::is_ascii_alphabetic`].
#[inline]
#[must_use]
pub const fn is_ascii_alphabetic(self) -> bool {
self.is_ascii_lowercase() || self.is_ascii_uppercase()
}

/// See [char::is_ascii_alphanumeric].
/// See [`char::is_ascii_alphanumeric`].
#[inline]
#[must_use]
pub const fn is_ascii_alphanumeric(self) -> bool {
self.is_ascii_alphabetic() || self.is_ascii_digit()
}

/// See [char::is_ascii_control].
/// See [`char::is_ascii_control`].
#[inline]
#[must_use]
pub const fn is_ascii_control(self) -> bool {
matches!(self.as_u32(), 0..=0x1f | 0x7f)
}

/// See [char::is_ascii_digit].
/// See [`char::is_ascii_digit`].
#[inline]
#[must_use]
pub const fn is_ascii_digit(self) -> bool {
Expand All @@ -443,14 +443,14 @@ impl JavaCodePoint {
matches!(self.as_u32(), ZERO..=NINE)
}

/// See [char::is_ascii_graphic].
/// See [`char::is_ascii_graphic`].
#[inline]
#[must_use]
pub const fn is_ascii_graphic(self) -> bool {
matches!(self.as_u32(), 0x21..=0x7e)
}

/// See [char::is_ascii_hexdigit].
/// See [`char::is_ascii_hexdigit`].
#[inline]
#[must_use]
pub const fn is_ascii_hexdigit(self) -> bool {
Expand All @@ -461,7 +461,7 @@ impl JavaCodePoint {
self.is_ascii_digit() || matches!(self.as_u32(), (LOWER_A..=LOWER_F) | (UPPER_A..=UPPER_F))
}

/// See [char::is_ascii_lowercase].
/// See [`char::is_ascii_lowercase`].
#[inline]
#[must_use]
pub const fn is_ascii_lowercase(self) -> bool {
Expand All @@ -470,7 +470,7 @@ impl JavaCodePoint {
matches!(self.as_u32(), A..=Z)
}

/// See [char::is_ascii_octdigit].
/// See [`char::is_ascii_octdigit`].
#[inline]
#[must_use]
pub const fn is_ascii_octdigit(self) -> bool {
Expand All @@ -479,7 +479,7 @@ impl JavaCodePoint {
matches!(self.as_u32(), ZERO..=SEVEN)
}

/// See [char::is_ascii_punctuation].
/// See [`char::is_ascii_punctuation`].
#[inline]
#[must_use]
pub const fn is_ascii_punctuation(self) -> bool {
Expand All @@ -489,7 +489,7 @@ impl JavaCodePoint {
)
}

/// See [char::is_ascii_uppercase].
/// See [`char::is_ascii_uppercase`].
#[inline]
#[must_use]
pub const fn is_ascii_uppercase(self) -> bool {
Expand All @@ -498,7 +498,7 @@ impl JavaCodePoint {
matches!(self.as_u32(), A..=Z)
}

/// See [char::is_ascii_whitespace].
/// See [`char::is_ascii_whitespace`].
#[inline]
#[must_use]
pub const fn is_ascii_whitespace(self) -> bool {
Expand All @@ -513,49 +513,49 @@ impl JavaCodePoint {
)
}

/// See [char::is_control].
/// See [`char::is_control`].
#[inline]
#[must_use]
pub fn is_control(self) -> bool {
self.as_char().is_some_and(|char| char.is_control())
}

/// See [char::is_digit].
/// See [`char::is_digit`].
#[inline]
#[must_use]
pub fn is_digit(self, radix: u32) -> bool {
self.to_digit(radix).is_some()
}

/// See [char::is_lowercase].
/// See [`char::is_lowercase`].
#[inline]
#[must_use]
pub fn is_lowercase(self) -> bool {
self.as_char().is_some_and(|char| char.is_lowercase())
}

/// See [char::is_numeric].
/// See [`char::is_numeric`].
#[inline]
#[must_use]
pub fn is_numeric(self) -> bool {
self.as_char().is_some_and(|char| char.is_numeric())
}

/// See [char::is_uppercase].
/// See [`char::is_uppercase`].
#[inline]
#[must_use]
pub fn is_uppercase(self) -> bool {
self.as_char().is_some_and(|char| char.is_uppercase())
}

/// See [char::is_whitespace].
/// See [`char::is_whitespace`].
#[inline]
#[must_use]
pub fn is_whitespace(self) -> bool {
self.as_char().is_some_and(|char| char.is_whitespace())
}

/// See [char::len_utf16]. Surrogate code points return 1.
/// See [`char::len_utf16`]. Surrogate code points return 1.
///
/// ```
/// # use java_string::JavaCodePoint;
Expand All @@ -578,7 +578,7 @@ impl JavaCodePoint {
}
}

/// See [char::len_utf8]. Surrogate code points return 3.
/// See [`char::len_utf8`]. Surrogate code points return 3.
///
/// ```
/// # use java_string::JavaCodePoint;
Expand Down Expand Up @@ -608,19 +608,19 @@ impl JavaCodePoint {
}
}

/// See [char::make_ascii_lowercase].
/// See [`char::make_ascii_lowercase`].
#[inline]
pub fn make_ascii_lowercase(&mut self) {
*self = self.to_ascii_lowercase();
}

/// See [char::make_ascii_uppercase].
/// See [`char::make_ascii_uppercase`].
#[inline]
pub fn make_ascii_uppercase(&mut self) {
*self = self.to_ascii_uppercase();
}

/// See [char::to_ascii_lowercase].
/// See [`char::to_ascii_lowercase`].
///
/// ```
/// # use java_string::JavaCodePoint;
Expand All @@ -644,7 +644,7 @@ impl JavaCodePoint {
}
}

/// See [char::to_ascii_uppercase].
/// See [`char::to_ascii_uppercase`].
///
/// ```
/// # use java_string::JavaCodePoint;
Expand All @@ -668,7 +668,7 @@ impl JavaCodePoint {
}
}

/// See [char::to_digit].
/// See [`char::to_digit`].
#[inline]
#[must_use]
pub const fn to_digit(self, radix: u32) -> Option<u32> {
Expand All @@ -679,7 +679,7 @@ impl JavaCodePoint {
}
}

/// See [char::to_lowercase].
/// See [`char::to_lowercase`].
#[inline]
#[must_use]
pub fn to_lowercase(self) -> ToLowercase {
Expand All @@ -689,7 +689,7 @@ impl JavaCodePoint {
}
}

/// See [char::to_uppercase].
/// See [`char::to_uppercase`].
#[inline]
#[must_use]
pub fn to_uppercase(self) -> ToUppercase {
Expand Down
Loading

0 comments on commit d89ecad

Please sign in to comment.