master > master: src - rust

This commit is contained in:
RD
2022-03-30 18:00:21 +02:00
parent 99b8bbd6a7
commit f41ec73a05
12 changed files with 793 additions and 0 deletions

View File

@@ -0,0 +1 @@
pub mod utils;

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

1
code/rust/src/lib.rs Normal file
View File

@@ -0,0 +1 @@
pub mod core;

15
code/rust/src/main.rs Normal file
View File

@@ -0,0 +1,15 @@
// ----------------------------------------------------------------
// IMPORTS
// ----------------------------------------------------------------
extern crate ads2;
use ads2::core::utils;
// ----------------------------------------------------------------
// MAIN METHOD
// ----------------------------------------------------------------
fn main() {
utils::greet();
}