https://github.com/optimalstrategy/plain-msgbox
A crate for generating plain message boxes
https://github.com/optimalstrategy/plain-msgbox
Last synced: over 1 year ago
JSON representation
A crate for generating plain message boxes
- Host: GitHub
- URL: https://github.com/optimalstrategy/plain-msgbox
- Owner: optimalstrategy
- License: mit
- Created: 2021-02-16T04:32:36.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-16T04:34:30.000Z (over 5 years ago)
- Last Synced: 2025-01-22T18:11:33.966Z (over 1 year ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plain-msgbox
A crate for generating plain message boxes like the one below (formatting is manual):
```bash
╭────────────────────────────────╮
│ Call stack size: 1024 │
│ Interning threshold: 20 │
│ Optimization level: 1 │
│ Optimizations: │
│ Constant Folding: true │
│ Peephole Optimizations: true │
│ Tail Call Optimization: true │
│ Dead Code Elimination: true │
│ (misc): cfg_export = false │
│ (misc): caching = true │
─────────────────────────╯
```
## Usage
Add this to your Cargo.toml:
```toml
[dependencies]
plain_msgbox = { git = "https://github.com/optimalstrategy/plain-msgbox" }
```
Then generate some boxes:
```rust
use plain_msgbox::generate_box;
let msg = generate_box(&[
format!("A vec: {:?}", vec![1, 2, 3]),
format!("A tuple: {:?}", (1, 2, 3)),
format!("A string: {}", "abcdefghi"),
]);
assert_eq!(msg, "\
╭─────────────────────╮
│ A vec: [1, 2, 3] │
│ A tuple: (1, 2, 3) │
│ A string: abcdefghi │
╰─────────────────────╯");
```