Skip to content

Commit

Permalink
New clippies and rust-analyzer chores for 1.84
Browse files Browse the repository at this point in the history
Signed-off-by: itowlson <[email protected]>
  • Loading branch information
itowlson committed Jan 29, 2025
1 parent abba902 commit e239b68
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions crates/compose/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use wac_graph::{CompositionGraph, NodeId};
/// dependent component. Finally, the composer will export all exports from the
/// dependent component to its dependents. The composer will then encode the
/// composition graph into a byte array and return it.
pub async fn compose<'a, L: ComponentSourceLoader>(
loader: &'a L,
pub async fn compose<L: ComponentSourceLoader>(
loader: &L,
component: &LockedComponent,
) -> Result<Vec<u8>, ComposeError> {
Composer::new(loader).compose(component).await
Expand Down
2 changes: 1 addition & 1 deletion crates/doctor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub mod manifest;
/// Diagnose for Rust-specific problems.
pub mod rustlang;
/// Test helpers.
pub mod test;
pub(crate) mod test;
/// Diagnoses for Wasm source problems.
pub mod wasm;

Expand Down
2 changes: 1 addition & 1 deletion crates/expressions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a> TryFrom<&'a str> for Key<'a> {
}
}

impl<'a> AsRef<str> for Key<'a> {
impl AsRef<str> for Key<'_> {
fn as_ref(&self) -> &str {
self.0
}
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-outbound-http/src/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub(crate) struct WasiHttpImplInner<'a> {
table: &'a mut ResourceTable,
}

impl<'a> WasiHttpView for WasiHttpImplInner<'a> {
impl WasiHttpView for WasiHttpImplInner<'_> {
fn ctx(&mut self) -> &mut WasiHttpCtx {
&mut self.state.wasi_http_ctx
}
Expand Down
4 changes: 2 additions & 2 deletions crates/factor-wasi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub struct MountFilesContext<'a> {
ctx: &'a mut WasiCtxBuilder,
}

impl<'a> MountFilesContext<'a> {
impl MountFilesContext<'_> {
pub fn preopened_dir(
&mut self,
host_path: impl AsRef<Path>,
Expand Down Expand Up @@ -284,7 +284,7 @@ struct WasiImplInner<'a> {
table: &'a mut ResourceTable,
}

impl<'a> WasiView for WasiImplInner<'a> {
impl WasiView for WasiImplInner<'_> {
fn ctx(&mut self) -> &mut WasiCtx {
self.ctx
}
Expand Down
4 changes: 2 additions & 2 deletions crates/factors-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub struct FactorsInstanceBuilder<'a, F: RuntimeFactors, U> {
factors: &'a F,
}

impl<'a, T: RuntimeFactors, U> FactorsInstanceBuilder<'a, T, U> {
impl<T: RuntimeFactors, U> FactorsInstanceBuilder<'_, T, U> {
/// Returns the app component for the instance.
pub fn app_component(&self) -> &AppComponent {
&self.app_component
Expand Down Expand Up @@ -223,7 +223,7 @@ impl<'a, T: RuntimeFactors, U> FactorsInstanceBuilder<'a, T, U> {
}
}

impl<'a, T: RuntimeFactors, U: Send> FactorsInstanceBuilder<'a, T, U> {
impl<T: RuntimeFactors, U: Send> FactorsInstanceBuilder<'_, T, U> {
/// Instantiates the instance with the given executor instance state
pub async fn instantiate(
self,
Expand Down
1 change: 1 addition & 0 deletions crates/oci/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ mod test {

// Convenience wrapper for deserializing from literal JSON
#[macro_export]
#[allow(missing_docs)] // it's test-only, but rust-analyzer gets mad
macro_rules! from_json {
($($json:tt)+) => {
serde_json::from_value(serde_json::json!($($json)+)).expect("valid json")
Expand Down
2 changes: 1 addition & 1 deletion crates/plugins/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pub enum PluginManagerUpdateGuard<'lock> {
Failed, // See comment on PluginManagerUpdateLock
}

impl<'lock> PluginManagerUpdateGuard<'lock> {
impl PluginManagerUpdateGuard<'_> {
pub fn denied(&self) -> bool {
matches!(self, Self::Denied)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/telemetry/src/propagation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub enum HeaderInjector<'a> {
Http1(&'a mut http1::HeaderMap),
}

impl<'a> Injector for HeaderInjector<'a> {
impl Injector for HeaderInjector<'_> {
fn set(&mut self, key: &str, value: String) {
match self {
HeaderInjector::Http0(headers) => {
Expand Down Expand Up @@ -77,7 +77,7 @@ pub enum HeaderExtractor<'a> {
Http1(&'a http1::HeaderMap),
}

impl<'a> Extractor for HeaderExtractor<'a> {
impl Extractor for HeaderExtractor<'_> {
fn get(&self, key: &str) -> Option<&str> {
match self {
HeaderExtractor::Http0(headers) => {
Expand Down
1 change: 1 addition & 0 deletions src/commands/up/app_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl std::fmt::Display for AppSource {
/// This represents a "partially loaded" source which has enough information to
/// dispatch to the correct trigger executor but hasn't (necessarily) gone
/// through full validation / loading yet.
#[allow(clippy::large_enum_variant)] // allow because the large variant is the common one
pub enum ResolvedAppSource {
File {
manifest_path: PathBuf,
Expand Down

0 comments on commit e239b68

Please sign in to comment.