Skip to content

Commit 52ae4bd

Browse files
committed
minor refactor: remove unnecessary error conversion
It was from a time where the `api` layer was tuned to work for the frontend, instead of being bare Rust.
1 parent 8d7f8c2 commit 52ae4bd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

crates/but-api/src/legacy/repo.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use gitbutler_repo::{
1414
};
1515
use tracing::instrument;
1616

17-
use crate::json::ToJsonError;
18-
1917
#[api_cmd_tauri]
2018
#[instrument(err(Debug))]
2119
pub fn git_get_local_config(project_id: ProjectId, key: String) -> Result<Option<String>> {
@@ -42,13 +40,10 @@ pub fn check_signing_settings(project_id: ProjectId) -> Result<bool> {
4240
pub fn git_clone_repository(repository_url: String, target_dir: PathBuf) -> Result<()> {
4341
let should_interrupt = AtomicBool::new(false);
4442

45-
gix::prepare_clone(repository_url.as_str(), &target_dir)
46-
.to_json_error()?
43+
gix::prepare_clone(repository_url.as_str(), &target_dir)?
4744
.fetch_then_checkout(gix::progress::Discard, &should_interrupt)
48-
.map(|(checkout, _outcome)| checkout)
49-
.to_json_error()?
50-
.main_worktree(gix::progress::Discard, &should_interrupt)
51-
.to_json_error()?;
45+
.map(|(checkout, _outcome)| checkout)?
46+
.main_worktree(gix::progress::Discard, &should_interrupt)?;
5247
Ok(())
5348
}
5449

0 commit comments

Comments
 (0)