All Projects → o2sh → add-one

o2sh / add-one

Licence: MIT license
adds one to a number

Programming Languages

rust
11053 projects

add-one

crate documentation

Returns n + 1.

Example

use add_one::add_one;

fn main() {
    let mut bytes = Vec::new();

    match add_one("123".as_bytes(), &mut bytes) {
        Ok(()) => println!("{}", std::str::from_utf8(&bytes).unwrap()),
        Err(e) => {
            eprintln!("Error: {}", e);
        }
    }
}

or

cargo install add-one
add-one 12
13
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].