-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Showing
17 changed files
with
1,215 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,6 @@ compare.js | |
Gemfile.lock | ||
vendor/ | ||
.env | ||
|
||
rust.iml | ||
platform/rust/target/ |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,64 @@ | ||
# http://doc.crates.io/manifest.html | ||
|
||
[package] | ||
name = "mailchecker" | ||
version = "0.1.0" | ||
authors = ["François-Guillaume Ribreau <[email protected]>"] | ||
|
||
# A short blurb about the package. This is not rendered in any format when | ||
# uploaded to crates.io (aka this is not markdown). | ||
description = "Cross-language temporary (disposable/throwaway) email detection library. Covers 2740 fake email providers." | ||
|
||
# These URLs point to more information about the repository. These are | ||
# intended to be webviews of the relevant data, not necessarily compatible | ||
# with VCS tools and the like. | ||
documentation = "https://github.com/FGRibreau/mailchecker" | ||
homepage = "https://github.com/FGRibreau/mailchecker" | ||
repository = "[email protected]:FGRibreau/mailchecker.git" | ||
|
||
# This points to a file in the repository (relative to this `Cargo.toml`). The | ||
# contents of this file are stored and indexed in the registry. | ||
readme = "README.md" | ||
|
||
# This is a list of up to five keywords that describe this crate. Keywords | ||
# are searchable on crates.io, and you may choose any words that would | ||
# help someone find this crate. | ||
keywords = ["email", "validation", "validator", "domains", "disposable"] | ||
|
||
# This is a list of up to five categories where this crate would fit. | ||
# Categories are a fixed list available at crates.io/category_slugs, and | ||
# they must match exactly. | ||
categories = ["email", "web-programming"] | ||
|
||
# This is a string description of the license for this package. Currently | ||
# crates.io will validate the license provided against a whitelist of known | ||
# license identifiers from http://spdx.org/licenses/. Multiple licenses can be | ||
# separated with a `/`. | ||
license = "MIT" | ||
|
||
include = ["src/lib.rs", "Cargo.toml"] | ||
|
||
[dependencies] | ||
regex = "0.2.1" | ||
fast_chemail = "0.9.3" | ||
|
||
[dev-dependencies] | ||
|
||
[lib] | ||
|
||
# This field points at where the crate is located, relative to the `Cargo.toml`. | ||
path = "src/lib.rs" | ||
|
||
# A flag for enabling unit tests for this target. This is used by `cargo test`. | ||
test = true | ||
|
||
# A flag for enabling documentation tests for this target. This is only relevant | ||
# for libraries, it has no effect on other sections. This is used by | ||
# `cargo test`. | ||
doctest = true | ||
|
||
# A flag for enabling benchmarks for this target. This is used by `cargo bench`. | ||
bench = true | ||
|
||
# A flag for enabling documentation of this target. This is used by `cargo doc`. | ||
doc = true |
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,20 @@ | ||
extern crate mailchecker; | ||
use std::iter::FromIterator; | ||
|
||
trait ExtendedIterator: Iterator { | ||
fn tail<B>(&mut self) -> B where B:FromIterator<Self::Item>, Self::Item: Eq + Clone, Self: Sized{ | ||
self.next(); | ||
self.collect() | ||
} | ||
} | ||
|
||
impl<I> ExtendedIterator for I where I: Iterator {} | ||
|
||
fn main() { | ||
// let arr = vec!["[email protected]", "a", "b"]; | ||
// let t: Vec<_> = arr.iter().tail(); | ||
// println!("Tail: {} {}", t[0], t[1]); | ||
// | ||
// let t: Vec<_> = "ok@[email protected]".split("@").tail(); | ||
println!("Ok: {:?}", mailchecker::is_valid("[email protected]")); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.