Fix clippy warnings

This commit is contained in:
Alyssa Ross 2023-10-28 13:20:49 +02:00
parent bcc2379d5b
commit e3729eb03b
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0
3 changed files with 6 additions and 7 deletions

View file

@ -95,14 +95,13 @@ pub fn branch_hydra_link(branch: &str) -> Option<String> {
.matches(branch)
.iter()
.next()
.map(|index| {
.and_then(|index| {
let regex = BRANCH_HYDRA_LINK_PATTERNS.get(index).unwrap();
BRANCH_HYDRA_LINKS_BY_INDEX
.get(index)
.map(move |link| regex.replace(branch, *link))
.map(move |l| format!("https://hydra.nixos.org/job/{}#tabs-constituents", l))
})
.flatten()
}
#[cfg(test)]

View file

@ -188,7 +188,7 @@ async fn main() {
let mut listeners: Vec<Pin<Box<dyn Future<Output = _>>>> = Vec::new();
for fd in (3..).into_iter().take(fd_count as usize) {
for fd in (3..).take(fd_count as usize) {
let s = server.clone();
if handle_error(is_socket_inet(fd), 74, "sd_is_socket_inet") {
listeners.push(Box::pin(s.listen(unsafe { TcpListener::from_raw_fd(fd) })));

View file

@ -56,7 +56,7 @@ impl<'a> Nixpkgs<'a> {
fn git_command(&self, subcommand: impl AsRef<OsStr>) -> Command {
let mut command = Command::new("git");
command.arg("-C");
command.arg(&self.path);
command.arg(self.path);
command.arg(subcommand);
command
}
@ -64,7 +64,7 @@ impl<'a> Nixpkgs<'a> {
async fn git_branch_contains(&self, commit: &str) -> Result<Vec<u8>> {
let output = self
.git_command("branch")
.args(&["-r", "--format=%(refname)", "--contains"])
.args(["-r", "--format=%(refname)", "--contains"])
.arg(commit)
.stderr(Stdio::inherit())
.output()
@ -79,7 +79,7 @@ impl<'a> Nixpkgs<'a> {
async fn git_fetch_nixpkgs(&self) -> Result<()> {
// TODO: add refspecs
self.git_command("fetch")
.arg(&self.remote_name)
.arg(self.remote_name)
.status()
.await
.map_err(Error::Io)
@ -109,7 +109,7 @@ impl<'a> Nixpkgs<'a> {
};
let mut prefix = PathBuf::from("refs/remotes/");
prefix.push(&self.remote_name);
prefix.push(self.remote_name);
for branch_name in output
.split(|byte| *byte == b'\n')