Skip to content

A Rust crate that extends Iterators to allow for skipping duplicates. Just for fun.

License

Notifications You must be signed in to change notification settings

DeedleFake/uniq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uniq

A Rust crate that extends Iterators to make it easier to skip duplicates. I wrote this just for the heck of it. I don't intend for it to ever be used.

Example

use std::io::{stdin, BufRead};
use std::fmt::{Display};

extern crate uniq;
use uniq::{UniqIterator};

fn panic<T, E>(e: Result<T, E>) -> T where E: Display {
	match e {
		Ok(e) => e,
		Err(err) => panic!("{}", err),
	}
}

fn main() {
	let stdin = stdin();
	for line in stdin.lock().lines().map(panic).uniq() {
		println!("{}", line);
	}
}

About

A Rust crate that extends Iterators to allow for skipping duplicates. Just for fun.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages