Skip to content

Commit e80d1ab

Browse files
MikeJerredehuss
authored andcommitted
style: fix code formatting
1 parent 2572c23 commit e80d1ab

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

libgit2-sys/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3423,7 +3423,8 @@ extern "C" {
34233423
their_tree: *const git_tree,
34243424
opts: *const git_merge_options,
34253425
) -> c_int;
3426-
pub fn git_merge_file_options_init(opts: *mut git_merge_file_options, version: c_uint) -> c_int;
3426+
pub fn git_merge_file_options_init(opts: *mut git_merge_file_options, version: c_uint)
3427+
-> c_int;
34273428
pub fn git_repository_state_cleanup(repo: *mut git_repository) -> c_int;
34283429

34293430
// merge analysis

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub use crate::index::{
101101
pub use crate::indexer::{Indexer, IndexerProgress, Progress};
102102
pub use crate::mailmap::Mailmap;
103103
pub use crate::mempack::Mempack;
104-
pub use crate::merge::{AnnotatedCommit, MergeOptions, MergeFileOptions, MergeFileResult};
104+
pub use crate::merge::{AnnotatedCommit, MergeFileOptions, MergeFileResult, MergeOptions};
105105
pub use crate::message::{
106106
message_prettify, message_trailers_bytes, message_trailers_strs, MessageTrailersBytes,
107107
MessageTrailersBytesIterator, MessageTrailersStrs, MessageTrailersStrsIterator,

src/merge.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use std::str;
77

88
use crate::call::Convert;
99
use crate::util::Binding;
10-
use crate::{raw, Commit, FileFavor, Oid};
1110
use crate::IntoCString;
11+
use crate::{raw, Commit, FileFavor, Oid};
1212

1313
/// A structure to represent an annotated commit, the input to merge and rebase.
1414
///
@@ -225,7 +225,10 @@ impl MergeFileOptions {
225225
their_label: None,
226226
raw: unsafe { mem::zeroed() },
227227
};
228-
assert_eq!(unsafe { raw::git_merge_file_options_init(&mut opts.raw, 1) }, 0);
228+
assert_eq!(
229+
unsafe { raw::git_merge_file_options_init(&mut opts.raw, 1) },
230+
0
231+
);
229232
opts
230233
}
231234

@@ -360,7 +363,8 @@ impl<'repo> MergeFileResult<'repo> {
360363
/// returns `None` if a filename conflict would occur,
361364
/// or if the path is not valid utf-8
362365
pub fn path(&self) -> Option<&str> {
363-
self.path_bytes().and_then(|bytes| str::from_utf8(bytes).ok())
366+
self.path_bytes()
367+
.and_then(|bytes| str::from_utf8(bytes).ok())
364368
}
365369

366370
/// Gets the path as a byte slice.
@@ -375,12 +379,7 @@ impl<'repo> MergeFileResult<'repo> {
375379

376380
/// The contents of the merge.
377381
pub fn content(&self) -> &'repo [u8] {
378-
unsafe {
379-
std::slice::from_raw_parts(
380-
self.raw.ptr as *const u8,
381-
self.raw.len as usize,
382-
)
383-
}
382+
unsafe { std::slice::from_raw_parts(self.raw.ptr as *const u8, self.raw.len as usize) }
384383
}
385384
}
386385

src/repo.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ use crate::{
2424
StashFlags,
2525
};
2626
use crate::{
27-
AnnotatedCommit, MergeAnalysis, MergeOptions, MergeFileOptions, MergeFileResult, MergePreference,
28-
SubmoduleIgnore, SubmoduleStatus, SubmoduleUpdate,
27+
AnnotatedCommit, MergeAnalysis, MergeFileOptions, MergeFileResult, MergeOptions,
28+
MergePreference, SubmoduleIgnore, SubmoduleStatus, SubmoduleUpdate,
2929
};
3030
use crate::{ApplyLocation, ApplyOptions, Rebase, RebaseOptions};
3131
use crate::{Blame, BlameOptions, Reference, References, ResetType, Signature, Submodule};
32-
use crate::{Blob, BlobWriter, Branch, BranchType, Branches, Commit, Config, Index, IndexEntry, Oid, Tree};
32+
use crate::{
33+
Blob, BlobWriter, Branch, BranchType, Branches, Commit, Config, Index, IndexEntry, Oid, Tree,
34+
};
3335
use crate::{Describe, IntoCString, Reflog, RepositoryInitMode, RevparseMode};
3436
use crate::{DescribeOptions, Diff, DiffOptions, Odb, PackBuilder, TreeBuilder};
3537
use crate::{Note, Notes, ObjectType, Revwalk, Status, StatusOptions, Statuses, Tag, Transaction};
@@ -4175,12 +4177,14 @@ mod tests {
41754177
opts.our_label("ours");
41764178
opts.their_label("theirs");
41774179
opts.style_diff3(true);
4178-
let merge_file_result = repo.merge_file_from_index(&base, &ours, &theirs, Some(&mut opts)).unwrap();
4180+
let merge_file_result = repo
4181+
.merge_file_from_index(&base, &ours, &theirs, Some(&mut opts))
4182+
.unwrap();
41794183

41804184
assert!(!merge_file_result.is_automergeable());
41814185
assert_eq!(
41824186
String::from_utf8_lossy(merge_file_result.content()).to_string(),
4183-
r"<<<<<<< ours
4187+
r"<<<<<<< ours
41844188
foo
41854189
||||||| ancestor
41864190
base

0 commit comments

Comments
 (0)