Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(versionable): add Send and Sync marker traits to Err type #1435

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions utils/tfhe-versionable/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ pub enum UnversionizeError {
Upgrade {
from_vers: String,
into_vers: String,
source: Box<dyn Error>,
source: Box<dyn Error + Send + Sync>,
},

/// An error has been returned in the conversion method provided by the `try_from` parameter
/// attribute
Conversion {
from_type: String,
source: Box<dyn Error>,
source: Box<dyn Error + Send + Sync>,
},
}

Expand Down Expand Up @@ -110,15 +110,19 @@ impl Error for UnversionizeError {
}

impl UnversionizeError {
pub fn upgrade<E: Error + 'static>(from_vers: &str, into_vers: &str, source: E) -> Self {
pub fn upgrade<E: Error + 'static + Send + Sync>(
from_vers: &str,
into_vers: &str,
source: E,
) -> Self {
Self::Upgrade {
from_vers: from_vers.to_string(),
into_vers: into_vers.to_string(),
source: Box::new(source),
}
}

pub fn conversion<E: Error + 'static>(from_type: &str, source: E) -> Self {
pub fn conversion<E: Error + 'static + Send + Sync>(from_type: &str, source: E) -> Self {
Self::Conversion {
from_type: from_type.to_string(),
source: Box::new(source),
Expand Down
Loading