Skip to content

Commit

Permalink
Don't trim mailto: prefix when converting a Uri into a string (#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-zahner committed Jun 10, 2024
1 parent 5475a4f commit 255164c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lychee-lib/src/types/uri/valid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ pub struct Uri {

impl Uri {
/// Returns the string representation of the `Uri`.
///
/// If it's an email address, returns the string with scheme stripped.
/// Otherwise returns the string as-is.
#[inline]
#[must_use]
pub fn as_str(&self) -> &str {
self.url.as_ref().trim_start_matches("mailto:")
self.url.as_ref()
}

#[inline]
Expand Down

0 comments on commit 255164c

Please sign in to comment.