mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-03 21:08:18 +00:00
Fix formatting of previous commit
This commit is contained in:
parent
d09f023618
commit
0c2dbd411b
11 changed files with 226 additions and 234 deletions
|
@ -2,7 +2,7 @@
|
|||
name = "dyn-any"
|
||||
version = "0.2.1"
|
||||
edition = "2021"
|
||||
authors = ["Dennis Kobert <dennis@kobert.dev>"]
|
||||
authors = ["Graphite Authors <contact@graphite.rs>"]
|
||||
|
||||
|
||||
description = "An Any trait that works for arbitrary lifetimes"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
name = "dyn-any-derive"
|
||||
version = "0.2.1"
|
||||
edition = "2021"
|
||||
authors = ["Dennis Kobert"]
|
||||
authors = ["Graphite Authors <contact@graphite.rs>"]
|
||||
|
||||
description = "#[derive(DynAny<'a>)]"
|
||||
documentation = "https://docs.rs/dyn-any-derive"
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "graphene-core"
|
|||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "API definitions for Graphene"
|
||||
authors = ["Dennis Kobert <dennis@kobert.dev>"]
|
||||
authors = ["Graphite Authors <contact@graphite.rs>"]
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
|
@ -9,8 +9,7 @@ pub struct ComposeNode<'n, Inter, First, Second> {
|
|||
_phantom2: PhantomData<Inter>,
|
||||
}
|
||||
|
||||
impl<'n, Input: 'n, Inter: 'n, First, Second> Node<'n, Input>
|
||||
for ComposeNode<'n, Input, Inter, First, Second>
|
||||
impl<'n, Input: 'n, Inter: 'n, First, Second> Node<'n, Input> for ComposeNode<'n, Input, Inter, First, Second>
|
||||
where
|
||||
First: Node<'n, Input, Output = Inter>,
|
||||
Second: Node<'n, Inter>, /*+ Node<<First as Node<Input>>::Output<'n>>*/
|
||||
|
@ -48,8 +47,7 @@ pub struct ComposeNodeOwned<'n, Input, Inter, FIRST, SECOND> {
|
|||
_phantom2: PhantomData<Inter>,
|
||||
}
|
||||
|
||||
impl<'n, Input: 'n, Inter: 'n, First, Second> Node<'n, Input>
|
||||
for ComposeNodeOwned<'n, Input, Inter, First, Second>
|
||||
impl<'n, Input: 'n, Inter: 'n, First, Second> Node<'n, Input> for ComposeNodeOwned<'n, Input, Inter, First, Second>
|
||||
where
|
||||
First: Node<'n, Input, Output = Inter>,
|
||||
Second: Node<'n, Inter>,
|
||||
|
@ -90,10 +88,7 @@ where
|
|||
}
|
||||
|
||||
pub trait After<I>: Sized {
|
||||
fn after<'n, First: Node<'n, I>>(
|
||||
&'n self,
|
||||
first: &'n First,
|
||||
) -> ComposeNode<'n, I, <First as Node<'n, I>>::Output, First, Self> {
|
||||
fn after<'n, First: Node<'n, I>>(&'n self, first: &'n First) -> ComposeNode<'n, I, <First as Node<'n, I>>::Output, First, Self> {
|
||||
ComposeNode::new(first, self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "graphene-std"
|
|||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Graphene standard library"
|
||||
authors = ["Dennis Kobert <dennis@kobert.dev>"]
|
||||
authors = ["Graphite Authors <contact@graphite.rs>"]
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
|
@ -30,8 +30,7 @@ where
|
|||
input.borrow().hash(&mut hasher);
|
||||
let hash = hasher.finish();
|
||||
|
||||
self.map
|
||||
.get_or_create_with(&hash, || CacheNode::new(self.node))
|
||||
self.map.get_or_create_with(&hash, || CacheNode::new(self.node))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,9 +39,6 @@ impl<'n, 'c, NODE: Node> SmartCacheNode<'n, 'c, NODE> {
|
|||
self.map = StorageMap::default();
|
||||
}
|
||||
pub fn new(node: &'n NODE) -> SmartCacheNode<'n, 'c, NODE> {
|
||||
SmartCacheNode {
|
||||
node,
|
||||
map: StorageMap::default(),
|
||||
}
|
||||
SmartCacheNode { node, map: StorageMap::default() }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "graph-proc-macros"
|
||||
version = "0.1.0"
|
||||
authors = ["Dennis Kobert <dennis@kobert.dev>"]
|
||||
authors = ["Graphite Authors <contact@graphite.rs>"]
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ pub fn to_node(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||
let string = item.to_string();
|
||||
let item2 = item;
|
||||
let parsed = parse_macro_input!(item2 as ItemFn); // 3
|
||||
|
||||
//item.extend(generate_to_string(parsed, string)); // 4
|
||||
//item
|
||||
generate_to_string(parsed, string)
|
||||
|
@ -40,6 +41,7 @@ fn generate_to_string(parsed: ItemFn, string: String) -> TokenStream {
|
|||
let whole_function = parsed.clone();
|
||||
//let fn_body = parsed.block; // function body
|
||||
let sig = parsed.sig; // function signature
|
||||
|
||||
//let vis = parsed.vis; // visibility, pub or not
|
||||
let generics = sig.generics;
|
||||
let fn_args = sig.inputs; // comma separated args
|
||||
|
@ -90,7 +92,6 @@ fn generate_to_string(parsed: ItemFn, string: String) -> TokenStream {
|
|||
position: (0., 0.),
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
//panic!("{}\n{:?}", x.to_string(), x);
|
||||
x.into()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue