Spec URL: https://orion.fedorapeople.org/rust-onenote_parser.spec SRPM URL: https://orion.fedorapeople.org/rust-onenote_parser-0.3.1-1.fc41.src.rpm Description: A parser for Microsoft OneNote® files. Fedora Account System Username: orion This is needed for clamav 1.3.0+ Currently is doesn't build due to changes in the widestring dep: error[E0412]: cannot find type `MissingNulError` in crate `widestring` --> src/errors.rs:54:23 | 54 | impl From<widestring::MissingNulError<u16>> for Error { | ^^^^^^^^^^^^^^^ not found in `widestring` error[E0412]: cannot find type `MissingNulError` in crate `widestring` --> src/errors.rs:55:30 | 55 | fn from(err: widestring::MissingNulError<u16>) -> Self { | ^^^^^^^^^^^^^^^ not found in `widestring` error[E0412]: cannot find type `MissingNulError` in crate `widestring` --> src/errors.rs:131:26 | 131 | err: widestring::MissingNulError<u16>, | ^^^^^^^^^^^^^^^ not found in `widestring` warning: unused import: `Cursor` --> src/onenote/mod.rs:9:32 | 9 | use std::io::{BufReader, Read, Cursor}; | ^^^^^^ | = note: `#[warn(unused_imports)]` on by default For more information about this error, try `rustc --explain E0412`. Help with that would be appreciated.
So my naive patch is: diff -up onenote_parser-0.3.1/src/errors.rs.widestring onenote_parser-0.3.1/src/errors.rs --- onenote_parser-0.3.1/src/errors.rs.widestring 2006-07-23 19:21:28.000000000 -0600 +++ onenote_parser-0.3.1/src/errors.rs 2024-04-22 21:31:52.083264294 -0600 @@ -51,8 +51,8 @@ impl From<std::string::FromUtf16Error> f } } -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 -up onenote_parser-0.3.1/src/utils.rs.widestring onenote_parser-0.3.1/src/utils.rs --- onenote_parser-0.3.1/src/utils.rs.widestring 2006-07-23 19:21:28.000000000 -0600 +++ onenote_parser-0.3.1/src/utils.rs 2024-04-22 21:41:02.878758421 -0600 @@ -12,7 +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)?; + let value = U16CString::from_vec_truncate(data); Ok(value.to_string()?) } I dropped the ? because rust said it couldn't be applied but that led to: error[E0277]: `?` couldn't convert the error to `errors::Error` --> src/utils.rs:17:29 | 17 | Ok(value.to_string()?) | ^ the trait `From<Utf16Error>` is not implemented for `errors::Error`, which is required by `std::result::Result<String, errors::Error>: FromResidual<std::result::Result<Infallible, Utf16Error>>` | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait = help: the following other types implement trait `From<T>`: <errors::Error as From<uuid::Error>> <errors::Error as From<widestring::error::MissingNulTerminator>> <errors::Error as From<errors::ErrorKind>> <errors::Error as From<std::io::Error>> <errors::Error as From<FromUtf16Error>> = note: required for `std::result::Result<String, errors::Error>` to implement `FromResidual<std::result::Result<Infallible, Utf16Error>>` At this point I'll just say I know nothing about rust and will stop. Help appreciated.
Found that upstream has actually merged some fixes so current version builds okay.