outsource parser in seperate mod

This commit is contained in:
lukas-heiligenbrunner 2022-12-05 00:03:22 +01:00
parent 7f1929e636
commit 9333489ff4
4 changed files with 5 additions and 4 deletions

View File

@ -6,12 +6,12 @@ rust-latest:
image: rust:latest image: rust:latest
script: script:
- cargo build --release - cargo build --release
- cargo test - cargo test --release
rust-nightly: rust-nightly:
stage: build stage: build
image: rustlang/rust:nightly image: rustlang/rust:nightly
script: script:
- cargo build --release - cargo build --release
- cargo test - cargo test --release
allow_failure: true allow_failure: true

View File

@ -1,10 +1,10 @@
mod mdstat_parser; mod parser;
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;
use rocket::serde::json::Json; use rocket::serde::json::Json;
use crate::mdstat_parser::{MdRaidSystem, parse_mdstat}; use crate::parser::mdstat_parser::{MdRaidSystem, parse_mdstat};
#[get("/raiddevices")] #[get("/raiddevices")]
fn get_raid_devices() -> Json<MdRaidSystem> { fn get_raid_devices() -> Json<MdRaidSystem> {

1
src/parser/mod.rs Normal file
View File

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