summaryrefslogtreecommitdiff
path: root/graph_macro/src/lib.rs
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2023-01-20 13:48:26 +0800
committerJSDurand <mmemmew@gmail.com>2023-01-20 13:48:26 +0800
commit18d7955b7d84c00467ede38baae53f4ce1fb6908 (patch)
tree97d0746b82816a21d980636e50f8cdbeb804b518 /graph_macro/src/lib.rs
parent8f8d3d1a3c276be4be2e5d2e767ada564c47279a (diff)
chain: a prototype is added.
I have an ostensibly working prototype now. Further tests are needed to make sure that the algorithm meets the time complexity requirement, though.
Diffstat (limited to 'graph_macro/src/lib.rs')
-rw-r--r--graph_macro/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/graph_macro/src/lib.rs b/graph_macro/src/lib.rs
index 5a0672b..a55efbb 100644
--- a/graph_macro/src/lib.rs
+++ b/graph_macro/src/lib.rs
@@ -1,12 +1,19 @@
+#![allow(unused_imports)]
//! This file provides a macro to delegate the implementation of a
//! type that wraps a graph. More precisely, the macro helps the
//! wrapper type implement the various Graph-related traits.
use proc_macro::TokenStream;
+use core::iter::Peekable;
+
#[proc_macro_derive(Testing)]
pub fn test_derive(input: TokenStream) -> TokenStream {
- println!("input: {input:?}");
+ let input = input.into_iter().peekable();
+
+ for tree in input {
+ println!("tree = {tree:?}");
+ }
TokenStream::new()
}