Skip to content

Commit 8927396

Browse files
authored
Merge pull request #837 from uuid-rs/fix/lifetime-syntaxes
Fix up mismatched_lifetime_syntaxes lint
2 parents 2fd9b61 + b508383 commit 8927396

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

macros/src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use crate::error::InvalidUuid;
1313

1414
#[inline]
15-
pub const fn try_parse(input: &str) -> Result<[u8; 16], InvalidUuid> {
15+
pub const fn try_parse(input: &'_ str) -> Result<[u8; 16], InvalidUuid<'_>> {
1616
let result = match (input.len(), input.as_bytes()) {
1717
// Inputs of 32 bytes must be a non-hyphenated UUID
1818
(32, s) => parse_simple(s),

src/parser.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl Uuid {
144144
}
145145
}
146146

147-
const fn try_parse(input: &[u8]) -> Result<[u8; 16], InvalidUuid> {
147+
const fn try_parse(input: &'_ [u8]) -> Result<[u8; 16], InvalidUuid<'_>> {
148148
match (input.len(), input) {
149149
// Inputs of 32 bytes must be a non-hyphenated UUID
150150
(32, s) => parse_simple(s),
@@ -164,7 +164,7 @@ const fn try_parse(input: &[u8]) -> Result<[u8; 16], InvalidUuid> {
164164

165165
#[inline]
166166
#[allow(dead_code)]
167-
pub(crate) const fn parse_braced(input: &[u8]) -> Result<[u8; 16], InvalidUuid> {
167+
pub(crate) const fn parse_braced(input: &'_ [u8]) -> Result<[u8; 16], InvalidUuid<'_>> {
168168
if let (38, [b'{', s @ .., b'}']) = (input.len(), input) {
169169
parse_hyphenated(s)
170170
} else {
@@ -174,7 +174,7 @@ pub(crate) const fn parse_braced(input: &[u8]) -> Result<[u8; 16], InvalidUuid>
174174

175175
#[inline]
176176
#[allow(dead_code)]
177-
pub(crate) const fn parse_urn(input: &[u8]) -> Result<[u8; 16], InvalidUuid> {
177+
pub(crate) const fn parse_urn(input: &'_ [u8]) -> Result<[u8; 16], InvalidUuid<'_>> {
178178
if let (45, [b'u', b'r', b'n', b':', b'u', b'u', b'i', b'd', b':', s @ ..]) =
179179
(input.len(), input)
180180
{
@@ -185,7 +185,7 @@ pub(crate) const fn parse_urn(input: &[u8]) -> Result<[u8; 16], InvalidUuid> {
185185
}
186186

187187
#[inline]
188-
pub(crate) const fn parse_simple(s: &[u8]) -> Result<[u8; 16], InvalidUuid> {
188+
pub(crate) const fn parse_simple(s: &'_ [u8]) -> Result<[u8; 16], InvalidUuid<'_>> {
189189
// This length check here removes all other bounds
190190
// checks in this function
191191
if s.len() != 32 {
@@ -217,7 +217,7 @@ pub(crate) const fn parse_simple(s: &[u8]) -> Result<[u8; 16], InvalidUuid> {
217217
}
218218

219219
#[inline]
220-
pub(crate) const fn parse_hyphenated(s: &[u8]) -> Result<[u8; 16], InvalidUuid> {
220+
pub(crate) const fn parse_hyphenated(s: &'_ [u8]) -> Result<[u8; 16], InvalidUuid<'_>> {
221221
// This length check here removes all other bounds
222222
// checks in this function
223223
if s.len() != 36 {

0 commit comments

Comments
 (0)