Unnamed repository; edit this file 'description' to name the repository.
fix smol_str compilation error
the command 'cargo build --no-default-features --features borsh' failed with: error[E0599]: no function or associated item named 'other' found for struct 'borsh::io::Error' in the current scope --> lib/smol_str/src/borsh.rs:33:39 | 33 | .ok_or_else(|| Error::other("u8::vec_from_reader unexpectedly returned None"))?; | ^^^^^ function or associated item not found in 'borsh::io::Error' |
Alexander Kjäll 2 months ago
parent b7d3e7b · commit 3f82306
-rw-r--r--lib/smol_str/src/borsh.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/smol_str/src/borsh.rs b/lib/smol_str/src/borsh.rs
index 527ce85a17..b684a4910c 100644
--- a/lib/smol_str/src/borsh.rs
+++ b/lib/smol_str/src/borsh.rs
@@ -29,8 +29,9 @@ impl BorshDeserialize for SmolStr {
}))
} else {
// u8::vec_from_reader always returns Some on success in current implementation
- let vec = u8::vec_from_reader(len, reader)?
- .ok_or_else(|| Error::other("u8::vec_from_reader unexpectedly returned None"))?;
+ let vec = u8::vec_from_reader(len, reader)?.ok_or_else(|| {
+ Error::new(ErrorKind::Other, "u8::vec_from_reader unexpectedly returned None")
+ })?;
Ok(SmolStr::from(String::from_utf8(vec).map_err(|err| {
let msg = err.to_string();
Error::new(ErrorKind::InvalidData, msg)