1- use include_tt:: include_tt ;
1+ use include_tt:: inject ;
22use std:: fmt:: Write ;
33
44macro_rules! test2_rules {
@@ -44,35 +44,35 @@ macro_rules! test2_rules {
4444
4545fn main ( ) {
4646 // Loading trees from a file and substituting them into a custom macro.
47- include_tt ! {
48- #POINT_TRACKER_FILES ;
47+ inject ! {
48+ #POINT_TRACKER_FILES :
4949 test2_rules! {
50- [ #include! ( "./examples/full.tt" ) ] // this file contains `a, b`.
51- [ #include! { "./examples/full.tt" } ] // this file contains `a, b`.
50+ [ #tt ( "./examples/full.tt" ) ] // this file contains `a, b`.
51+ [ #tt { "./examples/full.tt" } ] // this file contains `a, b`.
5252 }
5353 test2_rules! {
54- #include! ( "./examples/full.tt" ) // this file contains `a, b`.
54+ #tt ( "./examples/full.tt" ) // this file contains `a, b`.
5555 }
5656
5757 println!(
5858 concat!(
5959 "#" ,
60- #include_str! ( "./examples/full.tt" ) , // this file contains `a, b`.
60+ #str ( "./examples/full.tt" ) , // this file contains `a, b`.
6161 "#"
6262 )
6363 ) ;
6464 }
6565
6666 {
6767 // Loading a string from a file.
68- let str = include_tt ! ( #include_str! ( "./examples/full.tt" ) ) ; // this file contains `a, b`.
68+ let str = inject ! ( #str ( "./examples/full.tt" ) ) ; // this file contains `a, b`.
6969 assert_eq ! ( str , "a, b" ) ;
7070 }
7171
7272 {
7373 // Loading an array from a file.
74- let array: & ' static [ u8 ; 4 ] = include_tt ! (
75- #include_arr! ( "./examples/full.tt" ) // this file contains `a, b`.
74+ let array: & ' static [ u8 ; 4 ] = inject ! (
75+ #array ( "./examples/full.tt" ) // this file contains `a, b`.
7676 ) ;
7777 assert_eq ! ( array, b"a, b" ) ;
7878 }
@@ -83,12 +83,12 @@ fn main() {
8383 let b = 20 ;
8484
8585 let mut end_str = String :: new ( ) ;
86- include_tt ! {
86+ inject ! {
8787 let _e = write!(
8888 & mut end_str,
8989
9090 "arg1: {}, arg2: {}" ,
91- #include! ( "./examples/full.tt" ) // this file contains `a, b`.
91+ #tt ( "./examples/full.tt" ) // this file contains `a, b`.
9292 ) ;
9393 }
9494 assert_eq ! ( end_str, "arg1: 10, arg2: 20" ) ;
0 commit comments