Skip to content

Commit

Permalink
chore: Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeMathWalker committed Jan 20, 2025
1 parent 9faff05 commit e2d3014
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions libs/pavex_session/src/session_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ impl ClientSessionStateMut<'_> {
/// A mutable reference to the server-side state of a session.
pub struct ServerSessionStateMut<'session, 'store>(&'session mut Session<'store>);

impl<'session, 'store> ServerSessionStateMut<'session, 'store> {
impl ServerSessionStateMut<'_, '_> {
/// Get the value associated with `key` from the server-side state.
///
/// If the value is not found, `None` is returned.
Expand All @@ -459,7 +459,7 @@ impl<'session, 'store> ServerSessionStateMut<'session, 'store> {
}

/// Get the value associated with `key` from the server-side state.
pub async fn get_value<'a, 'b>(&'a self, key: &'b str) -> Result<Option<&'a Value>, LoadError> {
pub async fn get_value<'a>(&'a self, key: &str) -> Result<Option<&'a Value>, LoadError> {
server_get_value(self.0, key).await
}

Expand Down Expand Up @@ -754,7 +754,7 @@ impl<'session, 'store> ServerSessionStateMut<'session, 'store> {
/// A read-only reference to the server-side state of a session.
pub struct ServerSessionState<'session, 'store>(&'session Session<'store>);

impl<'session, 'store> ServerSessionState<'session, 'store> {
impl<'session> ServerSessionState<'session, '_> {
/// Get the value associated with `key` from the server-side state.
///
/// If the value is not found, `None` is returned.
Expand Down Expand Up @@ -818,8 +818,8 @@ fn client_get_value<'session>(
///
/// If the value is not found, `None` is returned.
/// If the value cannot be deserialized into the expected type, an error is returned.
async fn server_get<'store, T: DeserializeOwned>(
session: &Session<'store>,
async fn server_get<T: DeserializeOwned>(
session: &Session<'_>,
key: &str,
) -> Result<Option<T>, ServerGetError> {
server_get_value(session, key)
Expand All @@ -836,9 +836,9 @@ async fn server_get<'store, T: DeserializeOwned>(
}

/// Get the value associated with `key` from the server-side state.
async fn server_get_value<'a, 'b, 'store>(
session: &'a Session<'store>,
key: &'b str,
async fn server_get_value<'a>(
session: &'a Session<'_>,
key: &str,
) -> Result<Option<&'a Value>, LoadError> {
use ServerState::*;

Expand Down
2 changes: 1 addition & 1 deletion libs/pavexc/src/compiler/analyses/components/hydrated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'a> HydratedComponent<'a> {
}

pub(crate) fn is_fallible(&self) -> bool {
self.output_type().map_or(false, |t| t.is_result())
self.output_type().is_some_and(|t| t.is_result())
}

/// Returns a [`Computation`] that matches the transformation carried out by this component.
Expand Down
6 changes: 3 additions & 3 deletions libs/pavexc/src/rustdoc/compute/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,9 @@ impl<'a> ThirdPartyCrateCacheKey<'a> {
Id(&'a str),
}

impl<'a> Into<Cow<'a, str>> for PathOrId<'a> {
fn into(self) -> Cow<'a, str> {
match self {
impl<'a> From<PathOrId<'a>> for Cow<'a, str> {
fn from(val: PathOrId<'a>) -> Self {
match val {
PathOrId::Path(cow) => match cow {
Cow::Owned(path) => Cow::Owned(path.to_string()),
Cow::Borrowed(path) => Cow::Borrowed(path.as_str()),
Expand Down
6 changes: 3 additions & 3 deletions libs/pavexc/src/rustdoc/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ where
let package_id_specs: Vec<_> = package_id_specs.collect();
tracing::Span::current().record("package_id_specs", package_id_specs.iter().join(", "));
if package_id_specs.len() == 1 {
_compute_single_crate_docs(toolchain_name, &package_id_specs[0], current_dir)
_compute_single_crate_docs(toolchain_name, package_id_specs[0], current_dir)
} else {
_compute_multiple_crate_docs(toolchain_name, package_id_specs, current_dir)
}
Expand Down Expand Up @@ -257,9 +257,9 @@ fn _compute_single_crate_docs(
Ok(())
}

fn _compute_multiple_crate_docs<'a>(
fn _compute_multiple_crate_docs(
toolchain_name: &str,
package_id_specs: Vec<&'a PackageIdSpecification>,
package_id_specs: Vec<&PackageIdSpecification>,
current_dir: &Path,
) -> Result<(), anyhow::Error> {
let mut cmd = std::process::Command::new("rustup");
Expand Down
6 changes: 3 additions & 3 deletions libs/pavexc_cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::too_many_arguments)]
use std::collections::{BTreeMap, HashMap, HashSet};
use std::fmt::{Display, Formatter};
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -402,10 +403,9 @@ mod package_graph {
}
}

let metadata = tracing::info_span!("Invoke 'cargo metadata'")
tracing::info_span!("Invoke 'cargo metadata'")
.in_scope(|| guppy::MetadataCommand::new().exec())
.context("Failed to invoke `cargo metadata`")?;
metadata
.context("Failed to invoke `cargo metadata`")?
};
let graph = tracing::info_span!("Build package graph")
.in_scope(|| metadata.build_graph())
Expand Down

0 comments on commit e2d3014

Please sign in to comment.