File tree Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,3 @@ exclude = [
1818
1919[lib ]
2020proc-macro = true
21-
22- [dev-dependencies ]
23- unix-ts = { path = " .." , version = " 1" }
Original file line number Diff line number Diff line change 44use proc_macro:: TokenStream ;
55
66/// Create a timestamp from the given Unix timestamp.
7- ///
8- /// # Examples
9- ///
10- /// ```
11- /// use unix_ts_macros::ts;
12- ///
13- /// let t = ts!(1335020400);
14- /// assert_eq!(t.seconds(), 1335020400);
15- ///
16- /// let t = ts!(1335020400.25);
17- /// assert_eq!(t.seconds(), 1335020400);
18- /// assert_eq!(t.subsec(3), 250);
19- ///
20- /// let t = ts!(-86400);
21- /// assert_eq!(t.seconds(), -86400);
22- /// ```
237#[ proc_macro]
248pub fn ts ( input : TokenStream ) -> TokenStream {
259 let mut src = input. to_string ( ) . trim_start ( ) . trim_end ( ) . to_owned ( ) ;
You can’t perform that action at this time.
0 commit comments