Skip to content

Commit

Permalink
thanks clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 1, 2024
1 parent a097400 commit e28b4f1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.70.0"
msrv = "1.74.0"
2 changes: 1 addition & 1 deletion gix-credentials/src/helper/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl Action {
Action::Get(ctx) => ctx.write_to(write),
Action::Store(last) | Action::Erase(last) => {
write.write_all(last).ok();
write.write_all(&[b'\n']).ok();
write.write_all(b"\n").ok();
Ok(())
}
}
Expand Down
4 changes: 2 additions & 2 deletions gix-object/src/tree/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl crate::WriteTo for Tree {
.into());
}
out.write_all(filename)?;
out.write_all(&[b'\0'])?;
out.write_all(b"\0")?;

out.write_all(oid.as_bytes())?;
}
Expand Down Expand Up @@ -94,7 +94,7 @@ impl<'a> crate::WriteTo for TreeRef<'a> {
.into());
}
out.write_all(filename)?;
out.write_all(&[b'\0'])?;
out.write_all(b"\0")?;

out.write_all(oid.as_bytes())?;
}
Expand Down
2 changes: 1 addition & 1 deletion gix-packetline-blocking/src/encode/blocking_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn data_to_write(data: &[u8], out: impl io::Write) -> io::Result<usize> {

/// Write a `text` message to `out`, which is assured to end in a newline.
pub fn text_to_write(text: &[u8], out: impl io::Write) -> io::Result<usize> {
prefixed_and_suffixed_data_to_write(&[], text, &[b'\n'], out)
prefixed_and_suffixed_data_to_write(&[], text, b"\n", out)
}

fn prefixed_data_to_write(prefix: &[u8], data: &[u8], out: impl io::Write) -> io::Result<usize> {
Expand Down
2 changes: 1 addition & 1 deletion gix-packetline/src/encode/blocking_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn data_to_write(data: &[u8], out: impl io::Write) -> io::Result<usize> {

/// Write a `text` message to `out`, which is assured to end in a newline.
pub fn text_to_write(text: &[u8], out: impl io::Write) -> io::Result<usize> {
prefixed_and_suffixed_data_to_write(&[], text, &[b'\n'], out)
prefixed_and_suffixed_data_to_write(&[], text, b"\n", out)
}

fn prefixed_data_to_write(prefix: &[u8], data: &[u8], out: impl io::Write) -> io::Result<usize> {
Expand Down
16 changes: 8 additions & 8 deletions gix-refspec/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ impl Instruction<'_> {
allow_non_fast_forward,
}) => {
if *allow_non_fast_forward {
out.write_all(&[b'+'])?;
out.write_all(b"+")?;
}
out.write_all(src)?;
out.write_all(&[b':'])?;
out.write_all(b":")?;
out.write_all(dst)
}
Instruction::Push(Push::AllMatchingBranches { allow_non_fast_forward }) => {
if *allow_non_fast_forward {
out.write_all(&[b'+'])?;
out.write_all(b"+")?;
}
out.write_all(&[b':'])
out.write_all(b":")
}
Instruction::Push(Push::Delete { ref_or_pattern }) => {
out.write_all(&[b':'])?;
out.write_all(b":")?;
out.write_all(ref_or_pattern)
}
Instruction::Fetch(Fetch::Only { src }) => out.write_all(src),
Instruction::Fetch(Fetch::Exclude { src }) => {
out.write_all(&[b'^'])?;
out.write_all(b"^")?;
out.write_all(src)
}
Instruction::Fetch(Fetch::AndUpdate {
Expand All @@ -63,10 +63,10 @@ impl Instruction<'_> {
allow_non_fast_forward,
}) => {
if *allow_non_fast_forward {
out.write_all(&[b'+'])?;
out.write_all(b"+")?;
}
out.write_all(src)?;
out.write_all(&[b':'])?;
out.write_all(b":")?;
out.write_all(dst)
}
}
Expand Down
4 changes: 2 additions & 2 deletions gix-url/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ impl Url {
(Some(user), Some(host)) => {
out.write_all(user.as_bytes())?;
if let Some(password) = &self.password {
out.write_all(&[b':'])?;
out.write_all(b":")?;
out.write_all(password.as_bytes())?;
}
out.write_all(&[b'@'])?;
out.write_all(b"@")?;
out.write_all(host.as_bytes())?;
}
(None, Some(host)) => {
Expand Down

0 comments on commit e28b4f1

Please sign in to comment.