robinst / linkify

Rust library to find links such as URLs and email addresses in plain text, handling surrounding punctuation correctly
https://robinst.github.io/linkify/
Apache License 2.0
206 stars 12 forks source link

`non_exhaustive` attribute for `LinkKind` #60

Closed Colerar closed 1 year ago

Colerar commented 1 year ago

non_exhaustive (RFC 2008) attribute was added in Rust v1.40.0 (2019-12-19).

pub enum LinkKind {
    Url,
    Email,
    #[doc(hidden)]
    __Nonexhaustive,
}

The code above can be written idiomatically as:

#[non_exhaustive]
pub enum LinkKind {
    Url,
    Email,
}
robinst commented 1 year ago

Thanks, done!