Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created January 24, 2020 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/05cedab0df80a553832dea9a4ed596e6 to your computer and use it in GitHub Desktop.
Save rust-play/05cedab0df80a553832dea9a4ed596e6 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
#![allow(unused)]
fn main() {
/// Adds one to the number given.
///
/// # Examples
///
/// ```
/// let five = 5;
///
/// assert_eq!(6, my_crate::add_one(5));
/// ```
pub fn add_one(x: i32) -> i32 {
x + 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment