Skip to content

Commit 6911496

Browse files
committed
docs: 📝 Add README & Doc & LICENSE
1 parent c01228a commit 6911496

File tree

4 files changed

+72
-1
lines changed

4 files changed

+72
-1
lines changed

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
[package]
2-
name = "sstt"
2+
name = "SSTT"
33
version = "0.1.0"
44
edition = "2021"
5+
authors = ["Kaiyo Hugo"]
6+
keywords = ["syn", "traits","trait", "utility"]
7+
categories = ["category:development-tools::procedural-macro-helpers"]
8+
license = "MIT"
9+
description = "More Syn Syntax Tree Traversal Trait"
10+
repository = "https://github.com/MadyLab/SSTT"
11+
512

613
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
714

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) [year] [fullname]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<center>
2+
3+
# SSTT
4+
5+
More **S**yn **S**yntax **T**ree **T**raversal Trait
6+
7+
![GitHub](https://img.shields.io/github/license/madylab/sstt?style=for-the-badge) ![Crates.io](https://img.shields.io/crates/v/sstt?style=for-the-badge) ![docs.rs](https://img.shields.io/docsrs/sstt?style=for-the-badge)
8+
9+
SSTT crate provide some useful trait for syn syntax tree traversal.
10+
</center>
11+
12+
## Example
13+
14+
fallible [Fold](https://docs.rs/syn/latest/syn/fold/index.html)
15+
16+
```rust
17+
pub trait TryFold {
18+
type Error;
19+
20+
fn try_fold_abi(&mut self, t: syn::Abi) -> Result<syn::Abi, Self::Error>
21+
{
22+
try_fold_abi(self, t)
23+
}
24+
25+
// ...
26+
}
27+
```
28+
29+
fallible take (like fold but without return new value)
30+
31+
```rust
32+
pub trait TryTake {
33+
type Error;
34+
35+
fn try_take_abi(&mut self, t: syn::Abi) -> Result<(), Self::Error> {
36+
try_take_abi(self, t)
37+
}
38+
39+
// ...
40+
}
41+
```

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
#![doc = include_str!("../README.md")]
2+
13
pub mod try_fold;
24
pub mod try_take;

0 commit comments

Comments
 (0)