mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Don't crash when failing to decode using StrRef codec
This commit is contained in:
parent
d0109627b9
commit
0ade699873
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ impl<'a> BytesDecode<'a> for StrRefCodec {
|
|||
type DItem = &'a str;
|
||||
|
||||
fn bytes_decode(bytes: &'a [u8]) -> Option<Self::DItem> {
|
||||
let s = std::str::from_utf8(bytes).unwrap();
|
||||
let s = std::str::from_utf8(bytes).ok()?;
|
||||
Some(s)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue