1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
| | From f940d8c8fa087554583158d50df071af89c516db Mon Sep 17 00:00:00 2001
From: Simon Lamon <32477463+silamon@users.noreply.github.com>
Date: Sat, 19 Nov 2022 20:32:07 +0100
Subject: [PATCH] chore: upgrade dependencies (#9)
Co-authored-by: Markus Siemens <markus@m-siemens.de>
---
Cargo.toml.orig | 8 ++++----
src/errors.rs | 6 +++---
src/reader.rs | 2 +-
src/utils.rs | 5 ++---
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 9afddd0..e302436 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -14,15 +14,15 @@ categories = ["parser-implementations"]
backtrace = []
[dependencies]
-bytes = "0.5"
+bytes = "1.2.0"
encoding_rs = "0.8.31"
enum-primitive-derive = "0.2.2"
-itertools = "0.9.0"
+itertools = "0.10.3"
num-traits = "0.2"
paste = "1.0"
thiserror = "1.0"
-uuid = "0.8"
-widestring = "0.4.3"
+uuid = "1.1.2"
+widestring = "1.0.2"
[dev-dependencies]
insta = "1.21.1"
diff --git a/src/errors.rs b/src/errors.rs
index 91477b3..50079a3 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -51,8 +51,8 @@ impl From<std::string::FromUtf16Error> for Error {
}
}
-impl From<widestring::MissingNulError<u16>> for Error {
- fn from(err: widestring::MissingNulError<u16>) -> Self {
+impl From<widestring::error::MissingNulTerminator> for Error {
+ fn from(err: widestring::error::MissingNulTerminator) -> Self {
ErrorKind::from(err).into()
}
}
@@ -128,6 +128,6 @@ pub enum ErrorKind {
#[error("UTF-16 string is missing null terminator: {err}")]
Utf16MissingNull {
#[from]
- err: widestring::MissingNulError<u16>,
+ err: widestring::error::MissingNulTerminator,
},
}
diff --git a/src/reader.rs b/src/reader.rs
index 64730d0..318c280 100644
--- a/src/reader.rs
+++ b/src/reader.rs
@@ -40,7 +40,7 @@ impl<'a> Reader<'a> {
}
pub(crate) fn bytes(&self) -> &[u8] {
- self.0.bytes()
+ self.0.chunk()
}
pub(crate) fn remaining(&self) -> usize {
diff --git a/src/utils.rs b/src/utils.rs
index fd77181..074ff50 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -12,8 +12,7 @@ impl Utf16ToString for &[u8] {
.map(|v| u16::from_le_bytes([v[0], v[1]]))
.collect();
- let value = U16CString::from_vec_with_nul(data)?;
-
- Ok(value.to_string()?)
+ let value = U16CString::from_vec_truncate(data);
+ Ok(value.to_string().unwrap())
}
}
|