Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/offchainlabs/sneks
https://github.com/offchainlabs/sneks
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/offchainlabs/sneks
- Owner: OffchainLabs
- Created: 2023-09-28T22:13:43.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-10T21:55:07.000Z (5 months ago)
- Last Synced: 2024-10-31T11:34:44.370Z (17 days ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: licenses/Apache-2.0
Awesome Lists containing this project
README
## Overview
This crate provides simple proc macros for naming enum variants.
```rs
#[derive(SimpleSnakeNames)]
enum Animal {
HoneyBee,
GreatWhiteShark(usize),
PoisonDartFrog { spotted: bool },
}// expands to
impl Animal {
fn name(&self) -> &'static str {
match self {
HoneyBee => "honey_bee",
GreatWhiteShark(..) => "great_white_shark",
PoisonDartFrog { .. } => "poison_dart_frog",
}
}
}
```## License
© 2022-2023 Offchain Labs, Inc.
This project is licensed under either of
- [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) ([licenses/Apache-2.0](licenses/Apache-2.0))
- [MIT license](https://opensource.org/licenses/MIT) ([licenses/MIT](licenses/MIT))at your option.
The [SPDX](https://spdx.dev) license identifier for this project is `MIT OR Apache-2.0`.