1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-12 18:10:47 +02:00
guix/gnu/packages/patches/rust-onenote-parser-for-clamav-deps.patch
Nicolas Graves 02cd7d7586
gnu: Add rust-onenote-parser-for-clamav.
* gnu/packages/crates-io.scm (rust-onenote-parser-for-clamav): New
variable.
* gnu/packages/patches/rust-onenote-parser-for-clamav-deps.patch
* gnu/packages/patches/rust-onenote-parser-for-clamav-parse-in-memory-buffer.patch
* gnu/packages/patches/rust-onenote-parser-for-clamav-property-type.patch
Add patches here...
* gnu/local.mk: ...and here.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Change-Id: I6c2bb1d7afef8328317a54dcfee9204614864e64
2025-01-07 08:57:15 +02:00

88 lines
2.4 KiB
Diff

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())
}
}