-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alisha
committed
Jun 21, 2017
1 parent
90d7961
commit 74ca0d2
Showing
3 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,16 @@ | ||
extern crate itertools; | ||
|
||
use itertools::{join, max, sorted}; | ||
|
||
fn main(){ | ||
let a = [3, 2, 5, 8, 7]; | ||
|
||
// Combine all iterator elements into one String, | ||
// seperated by *. | ||
println!("{:?}", join(&a, "*")); | ||
// Return the maximum value of the iterable. | ||
println!("{:?}", max(a.iter()).unwrap()); | ||
// Collect all the iterable's elements into a | ||
// sorted vector in ascending order. | ||
println!("{:?}", sorted(a.iter())); | ||
} |