ao
add-one
cargo install add-one
ao

add-one

adds one to a number

by Ossama Hjaji

1.0.0 (see all)License:MIT
cargo install add-one
Readme

add-one

crate documentation minimum rustc 1.26 Travis status

Returns n + 1.

Usage

Add this to your Cargo.toml:

[dependencies]
add-one = "1.0"

and this to your crate root:

extern crate add_one;

Example

extern crate add_one;
use add_one::add_one;

use std::str;

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

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

or

$ cargo run 12
$ 13

Thanks

License

Licensed under

Compatibility

The add-one crate is tested for rustc 1.26 and greater.

GitHub Stars

19

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

6

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.0
4yrs ago
0.2.4
4yrs ago
0.2.3
4yrs ago
0.2.2
4yrs ago
No alternatives found
No tutorials found
Add a tutorial