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

A few fixes after yesterday's mergepalooza #2782

Merged
merged 1 commit into from
Aug 28, 2024
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
6 changes: 3 additions & 3 deletions crates/compose/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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: LockedComponentSourceLoader>(
pub async fn compose<'a, L: ComponentSourceLoader>(
loader: &'a L,
component: &LockedComponent,
) -> Result<Vec<u8>, ComposeError> {
Expand All @@ -35,7 +35,7 @@ pub async fn compose<'a, L: LockedComponentSourceLoader>(

/// This trait is used to load component source code from a locked component source across various embdeddings.
#[async_trait::async_trait]
pub trait LockedComponentSourceLoader {
pub trait ComponentSourceLoader {
async fn load_component_source(
&self,
source: &locked::LockedComponentSource,
Expand Down Expand Up @@ -97,7 +97,7 @@ struct Composer<'a, L> {
loader: &'a L,
}

impl<'a, L: LockedComponentSourceLoader> Composer<'a, L> {
impl<'a, L: ComponentSourceLoader> Composer<'a, L> {
async fn compose(mut self, component: &LockedComponent) -> Result<Vec<u8>, ComposeError> {
let source = self
.loader
Expand Down
7 changes: 5 additions & 2 deletions crates/trigger/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl<T: Trigger> TriggerAppBuilder<T> {
struct SimpleComponentLoader;

#[async_trait]
impl spin_compose::LockedComponentSourceLoader for SimpleComponentLoader {
impl spin_compose::ComponentSourceLoader for SimpleComponentLoader {
async fn load_component_source(
&self,
source: &spin_app::locked::LockedComponentSource,
Expand Down Expand Up @@ -399,7 +399,10 @@ impl<T: Trigger> TriggerAppBuilder<T> {
let composed = spin_compose::compose(self, component.locked)
.await
.with_context(|| {
format!("failed to compose component {:?}", component.locked.id)
format!(
"failed to resolve dependencies for component {:?}",
component.locked.id
)
})?;

spin_core::Component::new(engine, composed)
Expand Down
293 changes: 0 additions & 293 deletions crates/trigger/src/loader.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title = "SIP 0XX - Spin Factors"
title = "SIP 021 - Spin Factors"
template = "main"
date = "2024-05-20T12:00:00Z"

Expand Down
Loading