#script #python #io #input #string #capitalize #simplfy

io_capitalize

A crate to simplfy Rust,s IO scripts as similar to Python

1 unstable release

0.1.0 Jan 24, 2025

#188 in #script

Download history 92/week @ 2025-01-20 17/week @ 2025-01-27 11/week @ 2025-02-03

120 downloads per month

MIT/Apache

5KB
57 lines

io_capitalize crate for Rust

This crate will make writing inputs in Rust alot easier as Python.

How to Use:

use io_capitalize::*;

// Import the crate to use.

fn main() {

let mut ask = input_str("How are you? ).to_lowercase;

if ask.contains(good) || ask.contains(nice) || ask.contains(cool) {

    ask = "good".to_string();
    // If you want to reassign your muttable variable, you must convert it to String. (&str aren't compatible.)

    print!("{}? Nice.", ask.capitalize());
}

else {
    print!("OH!");
}

// See how much simple it is? Also it works with other types by: (input_int) both i64 and i32, (input_float) both f64 and f32, (input_bool) for booleans.
// And the capitalize method is integrated, it is a Python equivalent of .capitalize() string method, useful to have though.

}

No runtime deps