From db6640e0c40da307ab4cb9fe86e9d9b099f71963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=B0=A7?= Date: Mon, 21 Jul 2025 10:46:29 +0800 Subject: [PATCH] fix: dangling pointer issues in `update(data: Data)` --- Sources/BLAKE3/BLAKE3.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/BLAKE3/BLAKE3.swift b/Sources/BLAKE3/BLAKE3.swift index b9ee4ff..ee8e41d 100644 --- a/Sources/BLAKE3/BLAKE3.swift +++ b/Sources/BLAKE3/BLAKE3.swift @@ -53,7 +53,7 @@ public final class BLAKE3 { /// hasher.update(data: data) /// ``` public func update(data: Data) { - update(bytes: data.withUnsafeBytes { $0 }) + data.withUnsafeBytes { update(bytes: $0 ) } } /// Finalize the hasher and return the hash as a buffer of bytes.