mirror of
https://github.com/TECHNOFAB11/aerosol.git
synced 2025-12-11 23:50:07 +01:00
Cargo Format
This commit is contained in:
parent
2c5dadba8d
commit
808bc022f3
4 changed files with 60 additions and 59 deletions
|
|
@ -96,11 +96,10 @@
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub extern crate tt_call;
|
pub extern crate tt_call;
|
||||||
|
|
||||||
|
mod context;
|
||||||
|
mod interface;
|
||||||
mod join;
|
mod join;
|
||||||
mod parse;
|
mod parse;
|
||||||
mod interface;
|
|
||||||
mod context;
|
|
||||||
|
|
||||||
|
|
||||||
/// The building block for this crate. Automatically implemented
|
/// The building block for this crate. Automatically implemented
|
||||||
/// for contexts providing a dependency of type `T`.
|
/// for contexts providing a dependency of type `T`.
|
||||||
|
|
@ -113,7 +112,7 @@ pub trait Provide<T> {
|
||||||
|
|
||||||
/// Implement this trait to provide a convenient syntax for
|
/// Implement this trait to provide a convenient syntax for
|
||||||
/// constructing implementations of dependencies.
|
/// constructing implementations of dependencies.
|
||||||
pub trait Factory<Args=()> {
|
pub trait Factory<Args = ()> {
|
||||||
type Object;
|
type Object;
|
||||||
fn build(args: Args) -> Result<Self::Object, anyhow::Error>;
|
fn build(args: Args) -> Result<Self::Object, anyhow::Error>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#![recursion_limit="512"]
|
#![recursion_limit = "512"]
|
||||||
|
#![allow(clippy::blacklisted_name)]
|
||||||
|
|
||||||
extern crate aerosol;
|
extern crate aerosol;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
@ -39,7 +40,9 @@ struct Bar;
|
||||||
|
|
||||||
impl aerosol::Factory<(Bar,)> for FooFactory {
|
impl aerosol::Factory<(Bar,)> for FooFactory {
|
||||||
type Object = Foo;
|
type Object = Foo;
|
||||||
fn build(_: (Bar,)) -> Result<Foo, anyhow::Error> { Ok(Foo) }
|
fn build(_: (Bar,)) -> Result<Foo, anyhow::Error> {
|
||||||
|
Ok(Foo)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aerosol::define_context!(
|
aerosol::define_context!(
|
||||||
|
|
@ -50,7 +53,6 @@ aerosol::define_context!(
|
||||||
);
|
);
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
||||||
//trace_macros!(true);
|
//trace_macros!(true);
|
||||||
//aerosol::test_macro!();
|
//aerosol::test_macro!();
|
||||||
tt_call! {
|
tt_call! {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue