Fix compatibility with uuid 1.12

uuid 1.12 introduced the NonNilUuid type, which can, like the Uuid
type, be parsed from a string. The Uuid type now implements
PartialEq<Self> and PartialEq<NonNilUuid>. That breaks type inferrence,
because the compiler now cannot know whether we want to parse a Uuid or
a NonNilUuid.

We thus have to be explicit.
This commit is contained in:
Jonas Schäfer 2025-01-21 19:05:28 +01:00
commit 4eff6303dc
2 changed files with 11 additions and 3 deletions

View file

@ -57,6 +57,7 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
and return simply Option<T> instead of Result<Option<T>> (!497)
- Add Message::get_best_body_cloned and Message::get_best_subject_cloned
to clone automatically when performance is not an issue (!497)
- Fix compatibility to uuid 1.12
Version 0.21.0:
2024-07-25 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>

View file

@ -187,6 +187,7 @@ pub struct TaskData {
mod tests {
use super::*;
use base64::prelude::*;
use uuid::Uuid;
#[cfg(target_pointer_width = "32")]
#[test]
@ -598,7 +599,9 @@ mod tests {
let user_agent = auth.user_agent;
assert_eq!(
user_agent.id,
"d4565fa7-4d72-4749-b3d3-740edbf87770".try_into().unwrap()
"d4565fa7-4d72-4749-b3d3-740edbf87770"
.parse::<Uuid>()
.unwrap()
);
assert_eq!(user_agent.software.as_deref(), Some("AwesomeXMPP"));
assert_eq!(user_agent.device.as_deref(), Some("Kiva's Phone"));
@ -639,7 +642,9 @@ mod tests {
let user_agent = auth.user_agent;
assert_eq!(
user_agent.id,
"d4565fa7-4d72-4749-b3d3-740edbf87770".try_into().unwrap()
"d4565fa7-4d72-4749-b3d3-740edbf87770"
.parse::<Uuid>()
.unwrap()
);
assert_eq!(user_agent.software.as_deref(), Some("AwesomeXMPP"));
assert_eq!(user_agent.device.as_deref(), Some("Kiva's Phone"));
@ -709,7 +714,9 @@ mod tests {
assert_eq!(
auth.user_agent.id,
"d4565fa7-4d72-4749-b3d3-740edbf87770".try_into().unwrap()
"d4565fa7-4d72-4749-b3d3-740edbf87770"
.parse::<Uuid>()
.unwrap()
);
assert_eq!(auth.user_agent.software.as_deref(), Some("AwesomeXMPP"));
assert_eq!(auth.user_agent.device.as_deref(), Some("Kiva's Phone"));