Drop dependency on storekey::encode::Error in the serialiser (#3878)

This commit is contained in:
Rushmore Mushambi 2024-04-16 10:07:00 +02:00 committed by GitHub
parent e62bedf9bb
commit 126ca7a268
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -936,6 +936,10 @@ pub enum Error {
/// An error related to live query occurred
#[error("Failed to process Live Query: {0}")]
LiveQueryError(LiveQueryCause),
/// The supplied type could not be serialiazed into `sql::Value`
#[error("Serialization error: {0}")]
Serialization(String),
}
impl From<Error> for String {

View file

@ -35,7 +35,6 @@ use serde::ser::Serialize;
use serde::ser::SerializeMap as _;
use serde::ser::SerializeSeq as _;
use std::fmt::Display;
use storekey::encode::Error as EncodeError;
use vec::SerializeValueVec;
/// Convert a `T` into `surrealdb::sql::Value` which is an enum that can represent any valid SQL data.
@ -51,7 +50,7 @@ impl serde::ser::Error for Error {
where
T: Display,
{
Self::Encode(EncodeError::Message(msg.to_string()))
Self::Serialization(msg.to_string())
}
}