Skip to content

Commit 6680028

Browse files
committed
cargo init
1 parent fcb36a1 commit 6680028

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "regexpp-rs"
3+
version = "0.1.0"
4+
authors = ["Quentin M. Kniep <[email protected]>"]
5+
edition = "2018"
6+
7+
[dependencies]

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
mod validator;
2+
3+
pub use validator::ESRegexValidator;
4+
5+
#[cfg(test)]
6+
mod tests {
7+
#[test]
8+
fn it_works() {
9+
assert_eq!(2 + 2, 4);
10+
}
11+
}

src/validator.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright (C) 2020 Quentin M. Kniep <[email protected]>
2+
// Distributed under terms of the MIT license.
3+
4+
enum ESVersion {
5+
ES5,
6+
ES2015,
7+
ES2016,
8+
ES2017,
9+
ES2018,
10+
ES2019,
11+
ES2020,
12+
ES2021,
13+
}
14+
15+
pub struct ESRegexValidator {
16+
es_version: ESVersion,
17+
}
18+
19+
impl ESRegexValidator {
20+
fn new(es_version: ESVersion) -> Self {
21+
ESRegexValidator {
22+
es_version
23+
}
24+
}
25+
26+
fn validate(&self, regex: &str) {
27+
}
28+
}
29+
30+
31+
#[cfg(test)]
32+
mod tests {
33+
use super::*;
34+
35+
#[test]
36+
fn it_works() {
37+
}
38+
}

0 commit comments

Comments
 (0)