Skip to content

Commit f37037b

Browse files
committed
Preserve semver compatibility
1 parent 86777b3 commit f37037b

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/api/builder.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use std::{env, error::Error, path::PathBuf, sync::Arc};
22

3-
use crate::{config::ProtofetchConfig,
4-
fetch::ParallelConfig, git::cache::ProtofetchGitCache, Protofetch};
3+
use crate::{
4+
config::ProtofetchConfig, fetch::ParallelConfig, git::cache::ProtofetchGitCache, Protofetch,
5+
};
56

67
#[derive(Default)]
78
pub struct ProtofetchBuilder {

src/git/backend/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ pub mod error;
33
pub mod libgit2;
44
pub mod types;
55

6-
use std::path::{Path, PathBuf};
6+
use std::{
7+
panic::{RefUnwindSafe, UnwindSafe},
8+
path::{Path, PathBuf},
9+
};
710

811
use log::info;
912
use serde::Deserialize;
@@ -34,7 +37,7 @@ pub trait GitRepository {
3437
}
3538

3639
/// Factory for opening or creating git repositories.
37-
pub trait GitBackend {
40+
pub trait GitBackend: Send + Sync + UnwindSafe + RefUnwindSafe {
3841
/// Initialize a new bare repository at the given path and return a handle to it.
3942
fn init_bare(&self, path: &Path) -> Result<Box<dyn GitRepository>, GitBackendError>;
4043

src/git/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl ProtofetchGitCache {
8383
Ok(())
8484
}
8585

86-
pub fn repository(&self, entry: &Coordinate) -> Result<ProtoGitRepository<'_>, CacheError> {
86+
pub fn repository(&self, entry: &Coordinate) -> Result<ProtoGitRepository, CacheError> {
8787
let mut path = self.location.clone();
8888
path.push(entry.to_path());
8989

src/git/repository.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl ProtoGitRepository {
4343
repo: Box<dyn GitRepository>,
4444
origin: String,
4545
worktrees_base: &Path,
46-
) -> ProtoGitRepository<'_> {
46+
) -> ProtoGitRepository {
4747
ProtoGitRepository {
4848
repo,
4949
origin,

0 commit comments

Comments
 (0)