ads2_2022/code/rust/src/core/utils.rs

26 lines
733 B
Rust

// ----------------------------------------------------------------
// 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!");
}