Files
rust-users/examples/list.rs
T
Ben S 5c52889e09 Merge branch 'all-users' of https://github.com/polachok/rust-users into polachok-all-users
# Conflicts:
#	src/lib.rs

I put the users iterator functionality into the 'base' module, where it belongs now (but didn't when the code was written)
2016-01-29 11:20:07 +00:00

12 lines
279 B
Rust

extern crate users;
use users::{User, AllUsers};
fn main() {
let mut users: Vec<User> = unsafe { AllUsers::new() }.collect();
users.sort_by(|a, b| a.uid().cmp(&b.uid()));
for user in users {
println!("User {} has name {}", user.uid(), user.name());
}
}