Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Clippy #1791

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 4 additions & 7 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,7 @@ impl Api {
};
let resp = self.get(&path)?;
let pagination = resp.pagination();
rv.extend(
resp.convert_rnf::<Vec<Artifact>>(ApiErrorKind::ReleaseNotFound)?
.into_iter(),
);
rv.extend(resp.convert_rnf::<Vec<Artifact>>(ApiErrorKind::ReleaseNotFound)?);
if let Some(next) = pagination.into_next_cursor() {
cursor = next;
} else {
Expand Down Expand Up @@ -1349,7 +1346,7 @@ impl Api {
}
}
let pagination = resp.pagination();
rv.extend(resp.convert::<Vec<Monitor>>()?.into_iter());
rv.extend(resp.convert::<Vec<Monitor>>()?);
if let Some(next) = pagination.into_next_cursor() {
cursor = next;
} else {
Expand Down Expand Up @@ -1410,7 +1407,7 @@ impl Api {
}
}
let pagination = resp.pagination();
rv.extend(resp.convert::<Vec<Project>>()?.into_iter());
rv.extend(resp.convert::<Vec<Project>>()?);
if let Some(next) = pagination.into_next_cursor() {
cursor = next;
} else {
Expand All @@ -1435,7 +1432,7 @@ impl Api {
break;
} else {
let pagination = resp.pagination();
rv.extend(resp.convert::<Vec<Repo>>()?.into_iter());
rv.extend(resp.convert::<Vec<Repo>>()?);
if let Some(next) = pagination.into_next_cursor() {
cursor = next;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/bash_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::utils::releases::detect_release_name;

const BASH_SCRIPT: &str = include_str!("../bashsupport.sh");
lazy_static! {
static ref FRAME_RE: Regex = Regex::new(r#"^(.*?):(.*):(\d+)$"#).unwrap();
static ref FRAME_RE: Regex = Regex::new(r"^(.*?):(.*):(\d+)$").unwrap();
}

pub fn make_app<'a, 'b: 'a>(app: App<'a, 'b>) -> App<'a, 'b> {
Expand Down
12 changes: 6 additions & 6 deletions src/commands/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -913,14 +913,14 @@ fn execute_files_upload(
// Batch files upload
if path.is_dir() {
let ignore_file = matches.value_of("ignore_file").unwrap_or("");
let ignores = matches
let ignores: Vec<_> = matches
.values_of("ignore")
.map(|ignores| ignores.map(|i| format!("!{i}")).collect())
.unwrap_or_else(Vec::new);
let extensions = matches
.unwrap_or_default();
let extensions: Vec<_> = matches
.values_of("extensions")
.map(|extensions| extensions.map(|ext| ext.trim_start_matches('.')).collect())
.unwrap_or_else(Vec::new);
.unwrap_or_default();

let sources = ReleaseFileSearch::new(path.to_path_buf())
.ignore_file(ignore_file)
Expand Down Expand Up @@ -1081,10 +1081,10 @@ fn process_sources_from_paths(
.values_of("extensions")
.map(|extensions| extensions.map(|ext| ext.trim_start_matches('.')).collect())
.unwrap_or_else(|| vec!["js", "map", "jsbundle", "bundle"]);
let ignores = matches
let ignores: Vec<_> = matches
.values_of("ignore")
.map(|ignores| ignores.map(|i| format!("!{i}")).collect())
.unwrap_or_else(Vec::new);
.unwrap_or_default();

let opts = MatchOptions::new();
let collected_paths = paths.flat_map(|path| glob_with(path, opts).unwrap().flatten());
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod releases;
use mockito::{mock, server_url, Matcher, Mock};
use trycmd::TestCases;

pub const UTC_DATE_FORMAT: &str = r#"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6,9}Z"#;
pub const UTC_DATE_FORMAT: &str = r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6,9}Z";

pub fn register_test(path: &str) -> TestCases {
let test_case = TestCases::new();
Expand Down
Loading