Skip to content

Commit

Permalink
pass data4 by reference in QUuid::as_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbooth committed Dec 25, 2024
1 parent f135814 commit 59a6d08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/cxx-qt-lib/src/core/quuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ impl QUuid {
}
}

pub const fn as_fields(&self) -> (u32, u16, u16, [u8; 8]) {
(self.data1, self.data2, self.data3, self.data4)
pub const fn as_fields(&self) -> (u32, u16, u16, &[u8; 8]) {
(self.data1, self.data2, self.data3, &self.data4)
}

/// Creates a UUID from its representation as a byte array in big endian.
Expand Down Expand Up @@ -365,7 +365,7 @@ mod test {
#[test]
fn quuid_fields_round_trip() {
let uuid = QUuid::new_v4();
let (d1, d2, d3, d4) = uuid.as_fields();
let (d1, d2, d3, &d4) = uuid.as_fields();
let roundtrip = QUuid::from_fields(d1, d2, d3, d4);
assert_eq!(uuid, roundtrip)
}
Expand Down

0 comments on commit 59a6d08

Please sign in to comment.