Skip to content

Commit eaffb58

Browse files
phylum-botcd-work
andauthored
Bump dependencies (#1615)
Co-authored-by: Christian Duerr <cdurr@veracode.com>
1 parent 8459326 commit eaffb58

18 files changed

Lines changed: 57 additions & 61 deletions

File tree

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/src/api/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl PhylumApi {
130130
// here and be done.
131131
headers.insert(
132132
"Authorization",
133-
HeaderValue::from_str(&format!("Bearer {}", access_token)).unwrap(),
133+
HeaderValue::from_str(&format!("Bearer {access_token}")).unwrap(),
134134
);
135135
headers.insert("Accept", HeaderValue::from_str("application/json").unwrap());
136136

@@ -376,7 +376,7 @@ impl PhylumApi {
376376
label: label.unwrap_or_else(|| "uncategorized".to_string()),
377377
group_name,
378378
};
379-
log::debug!("==> Sending package submission: {:?}", req);
379+
log::debug!("==> Sending package submission: {req:?}");
380380
let resp: SubmitPackageResponse =
381381
self.post(endpoints::post_submit_job(&self.config.connection.uri)?, req).await?;
382382
Ok(resp.job_id)
@@ -451,7 +451,7 @@ impl PhylumApi {
451451
&& project.organization_name.as_deref() == org
452452
&& project.group_name.as_deref() == group
453453
})
454-
.ok_or_else(|| anyhow!("No project found with name {:?}", project_name).into())
454+
.ok_or_else(|| anyhow!("No project found with name {project_name:?}").into())
455455
.map(|project| project.id)
456456
}
457457

@@ -784,7 +784,7 @@ mod tests {
784784

785785
// Request should have been submitted with a bearer token
786786
let bearer_token = token_holder.lock().unwrap().take();
787-
assert_eq!(Some(format!("Bearer {}", DUMMY_ACCESS_TOKEN)), bearer_token);
787+
assert_eq!(Some(format!("Bearer {DUMMY_ACCESS_TOKEN}")), bearer_token);
788788

789789
Ok(())
790790
}

cli/src/auth/server.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ async fn spawn_server_and_get_auth_code(
123123

124124
// Get OIDC auth url.
125125
let state = state.into();
126-
let callback_url = Url::parse(&format!("http://{}/", auth_address))?;
126+
let callback_url = Url::parse(&format!("http://{auth_address}/"))?;
127127
let authorization_url =
128128
build_auth_url(redirect_type, locksmith_settings, &callback_url, code_challenge, &state)?;
129-
debug!("Authorization url is {}", authorization_url);
129+
debug!("Authorization url is {authorization_url}");
130130

131131
// Ensure external auth urls use https, rather than http.
132132
let auth_host = authorization_url
@@ -162,7 +162,7 @@ async fn spawn_server_and_get_auth_code(
162162
let router = Router::new().route("/", get(keycloak_callback_handler)).with_state(state.clone());
163163

164164
// Start server.
165-
debug!("Starting local login server at {:?}", auth_address);
165+
debug!("Starting local login server at {auth_address:?}");
166166
axum::serve(listener, router)
167167
.with_graceful_shutdown(async move { notify.notified().await })
168168
.await?;
@@ -235,7 +235,7 @@ mod test {
235235

236236
let result = handle_auth_flow(AuthAction::Login, None, None, false, &api_uri).await?;
237237

238-
debug!("{:?}", result);
238+
debug!("{result:?}");
239239

240240
Ok(())
241241
}
@@ -251,7 +251,7 @@ mod test {
251251

252252
let result = handle_auth_flow(AuthAction::Register, None, None, false, &api_uri).await?;
253253

254-
debug!("{:?}", result);
254+
debug!("{result:?}");
255255

256256
Ok(())
257257
}

cli/src/bin/phylum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async fn check_for_updates(config: &mut Config) -> Result<()> {
6464

6565
// Update last update check timestamp.
6666
config.last_update = Some(now);
67-
config.save().unwrap_or_else(|e| log::error!("Failed to save config: {}", e));
67+
config.save().unwrap_or_else(|e| log::error!("Failed to save config: {e}"));
6868

6969
if update::needs_update(false).await {
7070
print::print_update_message();

cli/src/commands/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub async fn handle_auth_token(config: &Config, matches: &clap::ArgMatches) -> C
9595
let api_uri = &config.connection.uri;
9696
let access_token =
9797
auth::renew_access_token(refresh_token, config.ignore_certs(), api_uri).await?;
98-
println!("{}", access_token);
98+
println!("{access_token}");
9999
Ok(ExitCode::Ok)
100100
} else {
101101
println!("{refresh_token}");

cli/src/commands/extensions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn add_extensions_subcommands(command: Command) -> Command {
7070
let extensions = match installed_extensions() {
7171
Ok(extensions) => extensions,
7272
Err(e) => {
73-
error!("Couldn't list extensions: {}", e);
73+
error!("Couldn't list extensions: {e}");
7474
return command;
7575
},
7676
};

cli/src/commands/find_dependency_files.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ use crate::commands::{CommandResult, ExitCode};
66
pub fn handle_command() -> CommandResult {
77
let depfiles = phylum_lockfile::DepFiles::find_at(".");
88
let json = serde_json::to_string(&depfiles)?;
9-
println!("{}", json);
9+
println!("{json}");
1010
Ok(ExitCode::Ok)
1111
}

cli/src/commands/jobs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ pub async fn handle_analyze(
180180
jobs_project.group,
181181
)
182182
.await?;
183-
debug!("Response => {:?}", job_id);
183+
debug!("Response => {job_id:?}");
184184

185185
if pretty_print {
186-
print_user_success!("Job ID: {}", job_id);
186+
print_user_success!("Job ID: {job_id}");
187187

188188
#[cfg(feature = "vulnreach")]
189189
let packages: Vec<_> = packages

cli/src/commands/project.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async fn handle_create_project(
112112
let group = matches.get_one::<String>("group").cloned();
113113
let org = config.org();
114114

115-
log::info!("Initializing new project: `{}`", project);
115+
log::info!("Initializing new project: `{project}`");
116116

117117
let project_config =
118118
create_project(api, project, org.map(|org| org.into()), group.clone(), repository_url)
@@ -121,14 +121,14 @@ async fn handle_create_project(
121121
Ok(project) => project,
122122
Err(PhylumApiError::Response(ResponseError { code: StatusCode::CONFLICT, .. })) => {
123123
let formatted_project = format_project_reference(org, group.as_deref(), project, None);
124-
print_user_failure!("Project {} already exists", formatted_project);
124+
print_user_failure!("Project {formatted_project} already exists");
125125
return Ok(ExitCode::AlreadyExists);
126126
},
127127
Err(err) => return Err(err.into()),
128128
};
129129

130130
config::save_config(Path::new(PROJ_CONF_FILE), &project_config).unwrap_or_else(|err| {
131-
print_user_failure!("Failed to save project file: {}", err);
131+
print_user_failure!("Failed to save project file: {err}");
132132
});
133133

134134
let project_id = Some(project_config.id.to_string());
@@ -307,7 +307,7 @@ async fn handle_link_project(
307307
};
308308

309309
config::save_config(Path::new(PROJ_CONF_FILE), &project_config)
310-
.unwrap_or_else(|err| log::error!("Failed to save user credentials to config: {}", err));
310+
.unwrap_or_else(|err| log::error!("Failed to save user credentials to config: {err}"));
311311

312312
let project_id = Some(project_config.id.to_string());
313313
let formatted_project =

cli/src/format.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub trait Format: Serialize {
3232
/// Output JSON format.
3333
fn json<W: Write>(&self, writer: &mut W) {
3434
let json = serde_json::to_string_pretty(&self).unwrap_or_else(|e| {
35-
log::error!("Failed to serialize json response: {}", e);
35+
log::error!("Failed to serialize json response: {e}");
3636
"".to_string()
3737
});
3838
let _ = writeln!(writer, "{json}");
@@ -65,7 +65,7 @@ impl Format for PhylumStatus {
6565
) {
6666
let label = style(label).blue();
6767
let _ = match option {
68-
Some(value) => writeln!(writer, "{label}: {}", value),
68+
Some(value) => writeln!(writer, "{label}: {value}"),
6969
None => writeln!(writer, "{label}: {}", style("null").italic().green()),
7070
};
7171
}
@@ -138,7 +138,7 @@ impl Format for PolicyEvaluationResponseRaw {
138138
let domain = rejection
139139
.source
140140
.domain
141-
.map_or_else(|| " ".into(), |domain| format!("[{}]", domain));
141+
.map_or_else(|| " ".into(), |domain| format!("[{domain}]"));
142142
let message = format!("{domain} {}", rejection.title);
143143

144144
let colored = match rejection.source.severity {
@@ -147,7 +147,7 @@ impl Format for PolicyEvaluationResponseRaw {
147147
_ => style(message).red(),
148148
};
149149

150-
let _ = writeln!(writer, " {}", colored);
150+
let _ = writeln!(writer, " {colored}");
151151
}
152152
}
153153
if !self.dependencies.is_empty() {
@@ -156,7 +156,7 @@ impl Format for PolicyEvaluationResponseRaw {
156156

157157
// Print web URI for the job results.
158158
if let Some(job_link) = &self.job_link {
159-
let _ = writeln!(writer, "You can find the interactive report here:\n {}", job_link);
159+
let _ = writeln!(writer, "You can find the interactive report here:\n {job_link}");
160160
}
161161
}
162162
}
@@ -508,7 +508,7 @@ impl Format for Vulnerability {
508508
// Print the callchain as arrow-separated packages.
509509
let _ = write!(writer, " {}", path[0]);
510510
for package in &path[1..] {
511-
let _ = write!(writer, " {} {}", arrow, package);
511+
let _ = write!(writer, " {arrow} {package}");
512512
}
513513

514514
let _ = writeln!(writer);

0 commit comments

Comments
 (0)