Untangle and move around setup structs
This commit is contained in:
parent
877af00806
commit
ac1c06dd31
7 changed files with 594 additions and 613 deletions
|
|
@ -228,7 +228,7 @@ impl<D> Resource for Cron<D> {
|
|||
use std::rc::{Rc, Weak};
|
||||
|
||||
pub trait FromResource<R> {
|
||||
fn from_resource(from: R) -> (Self, Weak<R>)
|
||||
fn from_resource(from: &Rc<R>) -> (Self, Weak<R>)
|
||||
where
|
||||
Self: Sized;
|
||||
}
|
||||
|
|
@ -250,8 +250,7 @@ macro_rules! default_resources {
|
|||
}
|
||||
|
||||
$(impl<'a, D> FromResource<$type> for DefaultResources<'a, D> {
|
||||
fn from_resource(from: $type) -> (Self, Weak<$type>) {
|
||||
let inner = Rc::new(from);
|
||||
fn from_resource(inner: &Rc<$type>) -> (Self, Weak<$type>) {
|
||||
(Self::$name(Rc::clone(&inner)), Rc::downgrade(&inner))
|
||||
}
|
||||
})*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue