Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandros committed Oct 22, 2024
1 parent fb161d9 commit 8fa62a4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ferrunix-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories.workspace = true
workspace = true

[features]
default = ["multithread", "tokio"]
default = []
multithread = ["once_cell/parking_lot"]
tokio = ["dep:tokio", "dep:async-trait"]

Expand Down
2 changes: 1 addition & 1 deletion ferrunix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories.workspace = true
workspace = true

[features]
default = ["derive", "tokio"]
default = ["derive"]
multithread = ["ferrunix-core/multithread"]
derive = ["dep:ferrunix-macros"]
tokio = ["ferrunix-core/tokio", "ferrunix-macros/tokio"]
Expand Down
27 changes: 27 additions & 0 deletions ferrunix/tests/it/derive_async.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// #![cfg(not(miri))]
#![allow(unused)]

use std::path::PathBuf;

use ferrunix::{Inject, RegistrationFunc, Registry};

Expand Down Expand Up @@ -27,6 +30,28 @@ use ferrunix::{Inject, RegistrationFunc, Registry};

// ferrunix::autoregister!(RegistrationFunc::new(Empty::register));

#[derive(Inject)]
#[provides(transient)]
struct CargoToml {
contents: String,
}

impl CargoToml {
#[allow(clippy::unwrap_used)]
pub async fn new() -> Self {
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR")
.map(PathBuf::from)
.unwrap();
let manifest_dir = manifest_dir.join("Cargo.toml");
let contents = tokio::fs::read_to_string(manifest_dir).await.unwrap();

Self { contents }
}

pub fn contents(&self) -> &str {
&self.contents
}
}

#[derive(Inject)]
#[provides(transient)]
Expand All @@ -37,6 +62,8 @@ struct Dep0 {}
struct Dep1 {
#[inject(transient)]
dep0: Dep0,
#[inject(ctor = "CargoToml::new().await")]
cargotoml: CargoToml,
}

#[derive(Inject)]
Expand Down

0 comments on commit 8fa62a4

Please sign in to comment.