Skip to content

Commit

Permalink
Use #[non_exhaustive] (stable since 1.40)
Browse files Browse the repository at this point in the history
Fixes #60.
  • Loading branch information
robinst committed Jun 24, 2023
1 parent 7331d75 commit 8717fd8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ impl<'t> Link<'t> {

/// The type of link that was found.
#[derive(Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum LinkKind {
/// URL links like "http://example.org".
Url,
/// E-mail links like "foo@example.org"
Email,
/// Users should not exhaustively match this enum, because more link types
/// may be added in the future.
#[doc(hidden)]
__Nonexhaustive,
}

/// Span within the input text.
Expand Down Expand Up @@ -172,7 +169,6 @@ impl LinkFinder {
match *kind {
LinkKind::Email => self.email = true,
LinkKind::Url => self.url = true,
_ => {}
}
}
self
Expand Down

0 comments on commit 8717fd8

Please sign in to comment.