Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ananduremanan/input_simplified
A simple input handling crate for Rust.
https://github.com/ananduremanan/input_simplified
crates-io rust rust-lang
Last synced: 24 days ago
JSON representation
A simple input handling crate for Rust.
- Host: GitHub
- URL: https://github.com/ananduremanan/input_simplified
- Owner: ananduremanan
- Created: 2024-07-01T04:35:34.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-01T06:38:57.000Z (5 months ago)
- Last Synced: 2024-10-09T17:29:51.256Z (about 1 month ago)
- Topics: crates-io, rust, rust-lang
- Language: Rust
- Homepage: https://crates.io/crates/input_simplified
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# input_simplified
A simple input handling crate for Rust.
## Usage
Add this to your `Cargo.toml`:
```toml
[dependencies]
input_simplified = "0.0.3"
``````rust
use input_simplified::input;fn main() {
let name: String = input()
.message("Enter your name: ")
.get_input()
.expect("Not a valid input");
println!("Hello, {}!", name);let age: i32 = input()
.message("Enter your age: ")
.get_input()
.expect("Not a valid input");
println!("You are {} years old.", age);let height: f64 = input()
.message("Enter your height in meters: ")
.get_input()
.expect("Not a valid input");
println!("You are {} meters tall.", height);
}
```