Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/artifact_failure/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
--exclude='bins' \
--exclude='.git' \
-zcf target/failure-${{ inputs.name }}.tar.gz .
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: target/failure-${{ inputs.name }}.tar.gz
6 changes: 3 additions & 3 deletions src/bin/sccache-dist/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ impl DockerBuilder {
.context("Unable to list all Docker containers")?;
if !containers.is_empty() {
let mut containers_to_rm = vec![];
for line in containers.split(|c| c == '\n') {
for line in containers.split('\n') {
let mut iter = line.splitn(2, ' ');
let container_id = iter
.next()
Expand Down Expand Up @@ -541,7 +541,7 @@ impl DockerBuilder {
.context("Failed to list all docker images")?;
if !images.is_empty() {
let mut images_to_rm = vec![];
for line in images.split(|c| c == '\n') {
for line in images.split('\n') {
let mut iter = line.splitn(2, ' ');
let image_id = iter
.next()
Expand Down Expand Up @@ -609,7 +609,7 @@ impl DockerBuilder {
let diff = docker_diff(cid)?;
if !diff.is_empty() {
let mut lastpath = None;
for line in diff.split(|c| c == '\n') {
for line in diff.split('\n') {
let mut iter = line.splitn(2, ' ');
let changetype = iter
.next()
Expand Down
2 changes: 1 addition & 1 deletion src/bin/sccache-dist/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn create_server_token(server_id: ServerId, auth_token: &str) -> String {
format!("{} {}", server_id.addr(), auth_token)
}
fn check_server_token(server_token: &str, auth_token: &str) -> Option<ServerId> {
let mut split = server_token.splitn(2, |c| c == ' ');
let mut split = server_token.splitn(2, ' ');
let server_addr = split.next().and_then(|addr| addr.parse().ok())?;
match split.next() {
Some(t) if t == auth_token => Some(ServerId::new(server_addr)),
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub struct Iter<'a, T> {
emitted: usize,
}

impl<'a, T: ArgumentValue> Iterator for Iter<'a, T> {
impl<T: ArgumentValue> Iterator for Iter<'_, T> {
type Item = OsString;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -218,7 +218,7 @@ pub struct IterStrings<'a, T, F> {
}

#[cfg(feature = "dist-client")]
impl<'a, T: ArgumentValue, F: FnMut(&Path) -> Option<String>> Iterator for IterStrings<'a, T, F> {
impl<T: ArgumentValue, F: FnMut(&Path) -> Option<String>> Iterator for IterStrings<'_, T, F> {
type Item = ArgToStringResult;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ where
.ok()
.map(|f| {
f.flatten()
.filter(|f| f.path().extension().map_or(false, |ext| ext == "bc"))
.filter(|f| f.path().extension().is_some_and(|ext| ext == "bc"))
.map(|f| f.path())
.collect()
})
Expand Down Expand Up @@ -1263,7 +1263,7 @@ impl pkg::InputsPackager for CInputsPackager {
if !super::CAN_DIST_DYLIBS
&& input_path
.extension()
.map_or(false, |ext| ext == std::env::consts::DLL_EXTENSION)
.is_some_and(|ext| ext == std::env::consts::DLL_EXTENSION)
{
bail!(
"Cannot distribute dylib input {} on this platform",
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/diab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl<'a> ExpandAtArgs<'a> {
}
}

impl<'a> Iterator for ExpandAtArgs<'a> {
impl Iterator for ExpandAtArgs<'_> {
type Item = OsString;

fn next(&mut self) -> Option<OsString> {
Expand Down
7 changes: 2 additions & 5 deletions src/compiler/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -969,15 +969,12 @@ impl<'a> ExpandIncludeFile<'a> {
}
}

impl<'a> Iterator for ExpandIncludeFile<'a> {
impl Iterator for ExpandIncludeFile<'_> {
type Item = OsString;

fn next(&mut self) -> Option<OsString> {
loop {
let arg = match self.stack.pop() {
Some(arg) => arg,
None => return None,
};
let arg = self.stack.pop()?;
let file = match arg.split_prefix("@") {
Some(arg) => self.cwd.join(arg),
None => return Some(arg),
Expand Down
11 changes: 4 additions & 7 deletions src/compiler/msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ impl<'a> ExpandIncludeFile<'a> {
}
}

impl<'a> Iterator for ExpandIncludeFile<'a> {
impl Iterator for ExpandIncludeFile<'_> {
type Item = OsString;

fn next(&mut self) -> Option<OsString> {
Expand All @@ -1197,10 +1197,7 @@ impl<'a> Iterator for ExpandIncludeFile<'a> {
}

// Visit the next argument provided by the original command iterator.
let arg = match self.args.pop() {
Some(arg) => arg,
None => return None,
};
let arg = self.args.pop()?;
let file_arg = match arg.split_prefix("@") {
Some(file_arg) => file_arg,
None => return Some(arg),
Expand Down Expand Up @@ -1290,7 +1287,7 @@ where
}
}

impl<'a> SplitMsvcResponseFileArgs<'a> {
impl SplitMsvcResponseFileArgs<'_> {
/// Appends backslashes to `target` by decrementing `count`.
/// If `step` is >1, then `count` is decremented by `step`, resulting in 1 backslash appended for every `step`.
fn append_backslashes_to(target: &mut String, count: &mut usize, step: usize) {
Expand All @@ -1301,7 +1298,7 @@ impl<'a> SplitMsvcResponseFileArgs<'a> {
}
}

impl<'a> Iterator for SplitMsvcResponseFileArgs<'a> {
impl Iterator for SplitMsvcResponseFileArgs<'_> {
type Item = String;

fn next(&mut self) -> Option<String> {
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ pub fn try_read_config_file<T: DeserializeOwned>(path: &Path) -> Result<Option<T
}
}

let res = if path.extension().map_or(false, |e| e == "json") {
let res = if path.extension().is_some_and(|e| e == "json") {
serde_json::from_str(&string)
.with_context(|| format!("Failed to load json config file from {}", path.display()))?
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/dist/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ mod server {
fn bearer_http_auth(request: &rouille::Request) -> Option<&str> {
let header = request.header("Authorization")?;

let mut split = header.splitn(2, |c| c == ' ');
let mut split = header.splitn(2, ' ');

let authtype = split.next()?;
if authtype != "Bearer" {
Expand Down
4 changes: 2 additions & 2 deletions src/dist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,14 @@ pub struct BuildResult {
// structs

pub struct ToolchainReader<'a>(Box<dyn Read + 'a>);
impl<'a> Read for ToolchainReader<'a> {
impl Read for ToolchainReader<'_> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
self.0.read(buf)
}
}

pub struct InputsReader<'a>(Box<dyn Read + Send + 'a>);
impl<'a> Read for InputsReader<'a> {
impl Read for InputsReader<'_> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
self.0.read(buf)
}
Expand Down
4 changes: 2 additions & 2 deletions src/lru_disk_cache/lru_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ impl<'a, K, V> DoubleEndedIterator for Iter<'a, K, V> {
}
}

impl<'a, K, V> ExactSizeIterator for Iter<'a, K, V> {
impl<K, V> ExactSizeIterator for Iter<'_, K, V> {
fn len(&self) -> usize {
self.0.len()
}
Expand Down Expand Up @@ -671,7 +671,7 @@ impl<'a, K, V> DoubleEndedIterator for IterMut<'a, K, V> {
}
}

impl<'a, K, V> ExactSizeIterator for IterMut<'a, K, V> {
impl<K, V> ExactSizeIterator for IterMut<'_, K, V> {
fn len(&self) -> usize {
self.0.len()
}
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ pub struct HashToDigest<'a> {
pub digest: &'a mut Digest,
}

impl<'a> Hasher for HashToDigest<'a> {
impl Hasher for HashToDigest<'_> {
fn write(&mut self, bytes: &[u8]) {
self.digest.update(bytes)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/harness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn stop_local_daemon() -> bool {
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.map_or(false, |status| status.success())
.is_ok_and(|status| status.success())
}

pub fn get_stats<F: 'static + Fn(ServerInfo)>(f: F) {
Expand Down
2 changes: 2 additions & 0 deletions tests/helpers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::result_large_err)]

use anyhow::{Context, Result};
use assert_cmd::assert::OutputAssertExt;
use chrono::Local;
Expand Down
Loading