Skip to content

Commit

Permalink
Merge pull request #578 from jpculp/repository-transport-send-sync
Browse files Browse the repository at this point in the history
tough: add Send and Sync to Repository transport
  • Loading branch information
jpculp authored Feb 28, 2023
2 parents 0229b1d + 252a7ba commit a592810
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tough/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ where
root: R,
metadata_base_url: Url,
targets_base_url: Url,
transport: Option<Box<dyn Transport>>,
transport: Option<Box<dyn Transport + Send + Sync>>,
limits: Option<Limits>,
datastore: Option<PathBuf>,
expiration_enforcement: Option<ExpirationEnforcement>,
Expand Down Expand Up @@ -197,7 +197,7 @@ impl<R: Read> RepositoryLoader<R> {

/// Set the transport. If no transport has been set, [`DefaultTransport`] will be used.
#[must_use]
pub fn transport<T: Transport + 'static>(mut self, transport: T) -> Self {
pub fn transport<T: Transport + Send + Sync + 'static>(mut self, transport: T) -> Self {
self.transport = Some(Box::new(transport));
self
}
Expand Down Expand Up @@ -295,7 +295,7 @@ pub enum Prefix {
/// You can create a `Repository` using a [`RepositoryLoader`].
#[derive(Debug, Clone)]
pub struct Repository {
transport: Box<dyn Transport>,
transport: Box<dyn Transport + Send + Sync>,
consistent_snapshot: bool,
datastore: Datastore,
earliest_expiration: DateTime<Utc>,
Expand Down
2 changes: 1 addition & 1 deletion tough/tests/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod http_happy {
run_http_test(DefaultTransport::default());
}

fn run_http_test<T: Transport + 'static>(transport: T) {
fn run_http_test<T: Transport + Send + Sync + 'static>(transport: T) {
let server = Server::run();
let repo_dir = test_data().join("tuf-reference-impl");
server.expect(create_successful_get("metadata/timestamp.json"));
Expand Down

0 comments on commit a592810

Please sign in to comment.