From 8a916ea17e8646a09f363883d33c786a7aeb3a9e Mon Sep 17 00:00:00 2001 From: MSxDOS <15524350+MSxDOS@users.noreply.github.com> Date: Tue, 16 Jul 2019 19:19:44 +0300 Subject: [PATCH] Fix UTF16Const::as_ref Don't include the terminating null --- src/string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string.rs b/src/string.rs index 3e06981..32bfa50 100644 --- a/src/string.rs +++ b/src/string.rs @@ -17,7 +17,7 @@ impl UTF16Const { impl AsRef<[u16]> for UTF16Const { #[inline] fn as_ref(&self) -> &[u16] { - self.0 + &self.0[..self.len()] } } impl Copy for UTF16Const {}