Skip to content

Commit

Permalink
Merge pull request #2782 from fibonacci1729/fixes
Browse files Browse the repository at this point in the history
A few fixes after yesterday's mergepalooza
  • Loading branch information
fibonacci1729 authored Aug 28, 2024
2 parents a1fe928 + 6a46329 commit 4e0ee4d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 299 deletions.
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

0 comments on commit 4e0ee4d

Please sign in to comment.