Crates.io | rust_is_even |
lib.rs | rust_is_even |
version | 0.1.0 |
source | src |
created_at | 2021-04-11 07:35:56.853957 |
updated_at | 2021-04-11 07:35:56.853957 |
description | Unofficial wrapper crate of [isevenapi](https://isevenapi.xyz/). |
homepage | |
repository | https://github.com/daikw/rust_is_even |
max_upload_size | |
id | 381936 |
size | 28,702 |
Check if interger is even using isevenapi.
// Cargo.toml: 'tokio = { version = "1.4.0", features = ["full"] }'
extern crate rust_is_even as ie;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let n: u32 = 42;
if ie::is_even(n).await? {
println!("{} is even", n);
} else {
println!("{} is odd", n);
}
Ok(())
}