Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blyxyas/must_be_empty
https://github.com/blyxyas/must_be_empty
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/blyxyas/must_be_empty
- Owner: blyxyas
- Created: 2022-12-28T00:47:04.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-01T12:23:10.000Z (almost 2 years ago)
- Last Synced: 2024-08-09T21:50:27.320Z (3 months ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Must be empty
This attribute checks that a given function is empty. It is just that.
This can be useful for debugging, when you're just using using `cargo test` and want to assure that nobody in a repository puts content in the main function, for example.## Example
```rust
use must_be_empty::must_be_empty;#[must_be_empty]
fn main() {}
```If you were to put something in that `main` function, it would give a warning or an error, depending on [your configuration](#features).
## Installation
Put this in your `Cargo.toml` file:
```toml
[dependencies]
must_be_empty = "0.1.0"
```## Features
* `warn` (*Default*): Warns, instead of outputing a hard-error.
* `only_on_release`: Only works in release mode (`--release`)
* `only_on_debug`: Only works in debug mode.