Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (15 sloc) 275 Bytes
pub fn identity<T>(x: T) -> T {
x
}
#[cfg(test)]
mod tests {
use super::identity;
#[test]
fn identity_of_3_is_3() {
assert_eq!(identity(3), 3);
}
#[test]
fn identity_of_true_is_true() {
assert_eq!(identity(true), true);
}
}