@@ -75,10 +75,7 @@ pub fn fetch_origin(repo_path: &str, branch: &str) -> Result<usize> {
75
75
let mut remote = repo. find_remote ( DEFAULT_REMOTE_NAME ) ?;
76
76
77
77
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 ) ) ;
82
79
83
80
remote. fetch ( & [ branch] , Some ( & mut options) , None ) ?;
84
81
@@ -100,15 +97,10 @@ pub fn push(
100
97
101
98
let mut options = PushOptions :: new ( ) ;
102
99
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
+ ) ) ;
112
104
options. packbuilder_parallelism ( 0 ) ;
113
105
114
106
remote. push ( & [ branch] , Some ( & mut options) ) ?;
@@ -119,7 +111,7 @@ pub fn push(
119
111
fn remote_callbacks < ' a > (
120
112
sender : Option < Sender < ProgressNotification > > ,
121
113
basic_credential : Option < BasicAuthCredential > ,
122
- ) -> Result < RemoteCallbacks < ' a > > {
114
+ ) -> RemoteCallbacks < ' a > {
123
115
let mut callbacks = RemoteCallbacks :: new ( ) ;
124
116
let sender_clone = sender. clone ( ) ;
125
117
callbacks. push_transfer_progress ( move |current, total, bytes| {
@@ -228,7 +220,7 @@ fn remote_callbacks<'a>(
228
220
} ,
229
221
) ;
230
222
231
- Ok ( callbacks)
223
+ callbacks
232
224
}
233
225
234
226
#[ cfg( test) ]
0 commit comments