Skip to content

Commit 7174817

Browse files
author
Stephan Dilly
committed
clippy nightly complaint
1 parent e797623 commit 7174817

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

asyncgit/src/sync/remotes.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ pub fn fetch_origin(repo_path: &str, branch: &str) -> Result<usize> {
7575
let mut remote = repo.find_remote(DEFAULT_REMOTE_NAME)?;
7676

7777
let mut options = FetchOptions::new();
78-
options.remote_callbacks(match remote_callbacks(None, None) {
79-
Ok(callback) => callback,
80-
Err(e) => return Err(e),
81-
});
78+
options.remote_callbacks(remote_callbacks(None, None));
8279

8380
remote.fetch(&[branch], Some(&mut options), None)?;
8481

@@ -100,15 +97,10 @@ pub fn push(
10097

10198
let mut options = PushOptions::new();
10299

103-
options.remote_callbacks(
104-
match remote_callbacks(
105-
Some(progress_sender),
106-
basic_credential,
107-
) {
108-
Ok(callbacks) => callbacks,
109-
Err(e) => return Err(e),
110-
},
111-
);
100+
options.remote_callbacks(remote_callbacks(
101+
Some(progress_sender),
102+
basic_credential,
103+
));
112104
options.packbuilder_parallelism(0);
113105

114106
remote.push(&[branch], Some(&mut options))?;
@@ -119,7 +111,7 @@ pub fn push(
119111
fn remote_callbacks<'a>(
120112
sender: Option<Sender<ProgressNotification>>,
121113
basic_credential: Option<BasicAuthCredential>,
122-
) -> Result<RemoteCallbacks<'a>> {
114+
) -> RemoteCallbacks<'a> {
123115
let mut callbacks = RemoteCallbacks::new();
124116
let sender_clone = sender.clone();
125117
callbacks.push_transfer_progress(move |current, total, bytes| {
@@ -228,7 +220,7 @@ fn remote_callbacks<'a>(
228220
},
229221
);
230222

231-
Ok(callbacks)
223+
callbacks
232224
}
233225

234226
#[cfg(test)]

0 commit comments

Comments
 (0)