Skip to content

Commit d505ce1

Browse files
committed
Format
1 parent 67676d2 commit d505ce1

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/build.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,14 @@ impl<'cb> RepoBuilder<'cb> {
173173

174174
/// Specify fetch depth, a value less than zero is interpreted as pull everything (effectively the same as no declaring a limit depth)
175175
pub fn depth(&mut self, depth: i32) -> &mut RepoBuilder<'cb> {
176-
if !self.fetch_opts
177-
.as_mut()
178-
.is_some_and(|fetch_opts| {
179-
fetch_opts.depth(depth); true
180-
}) {
181-
let mut fo = FetchOptions::new();
182-
fo.depth(depth);
183-
self.fetch_options(fo);
184-
}
176+
if !self.fetch_opts.as_mut().is_some_and(|fetch_opts| {
177+
fetch_opts.depth(depth);
178+
true
179+
}) {
180+
let mut fo = FetchOptions::new();
181+
fo.depth(depth);
182+
self.fetch_options(fo);
183+
}
185184

186185
self
187186
// if let Some(ref fetch_opts) = &self.fetch_opts {

src/remote.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ impl<'cb> FetchOptions<'cb> {
510510
follow_redirects: RemoteRedirect::Initial,
511511
custom_headers: Vec::new(),
512512
custom_headers_ptrs: Vec::new(),
513-
depth: 0 // Not limited depth
513+
depth: 0, // Not limited depth
514514
}
515515
}
516516

src/repo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl Repository {
342342
}
343343

344344
/// Clone a remote repository with a depth of one (shallow cloning)
345-
///
345+
///
346346
/// Similar to `git clone --depth 1`
347347
pub fn shallow_clone<P: AsRef<Path>>(url: &str, into: P) -> Result<Repository, Error> {
348348
RepoBuilder::new().depth(1).clone(url, into.as_ref())

0 commit comments

Comments
 (0)