master > master: src - rust
This commit is contained in:
1
code/rust/src/core/mod.rs
Normal file
1
code/rust/src/core/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod utils;
|
||||
25
code/rust/src/core/utils.rs
Normal file
25
code/rust/src/core/utils.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
// ----------------------------------------------------------------
|
||||
// IMPORTS
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
extern crate regex;
|
||||
|
||||
use self::regex::Regex;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// METHODS get regex
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
/// Constructs RegEx and panics if error.
|
||||
pub fn construct_regex(pattern: &str) -> Regex {
|
||||
return Regex::new(pattern)
|
||||
.expect("Invalid regex construction!");
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// METHOD hello world
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
pub fn greet() {
|
||||
println!("Hello world!");
|
||||
}
|
||||
Reference in New Issue
Block a user