Skip to content

Commit

Permalink
thanks clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Dec 13, 2021
1 parent 11b98b8 commit 4ca9e07
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions experiments/odb-redesign/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ mod odb {
pub(crate) fn remove_handle(&self, mode: store::HandleModeToken) {
match mode {
store::HandleModeToken::KeepDeletedPacksAvailable => {
let _ = self.state.lock();
let _lock = self.state.lock();
self.num_handles_stable.fetch_sub(1, Ordering::SeqCst)
}
store::HandleModeToken::DeletedPacksAreInaccessible => {
Expand All @@ -442,7 +442,7 @@ mod odb {
}
pub(crate) fn upgrade_handle(&self, mode: store::HandleModeToken) -> store::HandleModeToken {
if let store::HandleModeToken::DeletedPacksAreInaccessible = mode {
let _ = self.state.lock();
let _lock = self.state.lock();
self.num_handles_stable.fetch_add(1, Ordering::SeqCst);
self.num_handles_unstable.fetch_sub(1, Ordering::SeqCst);
}
Expand Down
4 changes: 2 additions & 2 deletions git-odb/src/store/general/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ pub mod handle {
pub(crate) fn remove_handle(&self, mode: Mode) {
match mode {
Mode::KeepDeletedPacksAvailable => {
let _ = self.path.lock();
let _lock = self.path.lock();
self.num_handles_stable.fetch_sub(1, Ordering::SeqCst)
}
Mode::DeletedPacksAreInaccessible => self.num_handles_unstable.fetch_sub(1, Ordering::Relaxed),
};
}
pub(crate) fn upgrade_handle(&self, mode: Mode) -> Mode {
if let Mode::DeletedPacksAreInaccessible = mode {
let _ = self.path.lock();
let _lock = self.path.lock();
self.num_handles_stable.fetch_add(1, Ordering::SeqCst);
self.num_handles_unstable.fetch_sub(1, Ordering::SeqCst);
}
Expand Down
2 changes: 1 addition & 1 deletion git-pack/src/cache/delta/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct Chunk<'a, T> {

// SAFETY: The raw pointer is uniquely materialized in `Node::into_child_iter`.
#[allow(unsafe_code)]
unsafe impl<'a, T> Send for Chunk<'a, T> {}
unsafe impl<'a, T> Send for Chunk<'a, T> where T: Send {}

impl<'a, T> Iterator for Chunk<'a, T> {
type Item = Node<'a, T>;
Expand Down
2 changes: 1 addition & 1 deletion git-protocol/tests/fetch/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async fn ls_remote() -> crate::Result {
);
assert_eq!(
transport.into_inner().1.as_bstr(),
b"003agit-upload-pack does/not/matter\0\0value-only\0key=value\00000".as_bstr(),
b"003agit-upload-pack does/not/matter\x00\x00value-only\x00key=value\x000000".as_bstr(),
"we dont have to send anything in V1, except for the final flush byte to indicate we are done"
);
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion git-protocol/tests/fetch/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async fn ls_remote_abort_in_prep_ls_refs() -> crate::Result {
assert!(delegate.refs.is_empty(), "no refs are fetched");
assert_eq!(
transport.into_inner().1.as_bstr(),
b"0044git-upload-pack does/not/matter\0\0version=2\0value-only\0key=value\00000".as_bstr()
b"0044git-upload-pack does/not/matter\x00\x00version=2\x00value-only\x00key=value\x000000".as_bstr()
);
match err {
fetch::Error::Io(err) => {
Expand Down
4 changes: 2 additions & 2 deletions git-transport/tests/client/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async fn handshake_v1_and_request() -> crate::Result {

assert_eq!(
out.as_slice().as_bstr(),
b"002egit-upload-pack /foo.git\0host=example.org\00000000ahello\n\
b"002egit-upload-pack /foo.git\x00host=example.org\x000000000ahello\n\
000aworld\n\
0009done\n"
.as_bstr(),
Expand Down Expand Up @@ -338,7 +338,7 @@ async fn handshake_v2_and_request_inner() -> crate::Result {

assert_eq!(
out.as_slice().as_bstr(),
b"0039git-upload-pack /bar.git\0host=example.org\0\0version=2\00014command=ls-refs
b"0039git-upload-pack /bar.git\x00host=example.org\x00\x00version=2\x000014command=ls-refs
0015agent=git/2.28.0
0017object-format=sha1
00010009peel
Expand Down
2 changes: 1 addition & 1 deletion git-url/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn guess_protocol(url: &[u8]) -> &str {

fn sanitize_for_protocol<'a>(protocol: &str, url: &'a str) -> Cow<'a, str> {
match protocol {
"ssh" => url.replacen(":", "/", 1).into(),
"ssh" => url.replacen(':', "/", 1).into(),
_ => url.into(),
}
}
Expand Down

0 comments on commit 4ca9e07

Please sign in to comment.