From 1d2128ca156994a54c20d44c8b437a1fc112fcb0 Mon Sep 17 00:00:00 2001 From: quirinecker Date: Tue, 24 Jan 2023 22:35:00 +0100 Subject: [PATCH] code cleanup --- src/app/commands/build.rs | 3 +-- src/app/fs_util/mod.rs | 8 -------- src/app/mod.rs | 1 - src/app/rx/mod.rs | 24 ------------------------ 4 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 src/app/rx/mod.rs diff --git a/src/app/commands/build.rs b/src/app/commands/build.rs index e4783de..9c8ea52 100644 --- a/src/app/commands/build.rs +++ b/src/app/commands/build.rs @@ -1,9 +1,8 @@ -use std::{collections::HashMap, fs, path::Path}; +use std::{collections::HashMap, path::Path}; use crate::app::{ builder::{asciidoctor::{AsciiDoctorDocsBuilder, AsciiDoctorSlideBuilder}, Builder}, fs_util, - rx::Observable, }; use super::traits::Command; diff --git a/src/app/fs_util/mod.rs b/src/app/fs_util/mod.rs index 320e3d4..6691f25 100644 --- a/src/app/fs_util/mod.rs +++ b/src/app/fs_util/mod.rs @@ -15,14 +15,6 @@ impl RecursivePathFetch { } } - pub fn new(path: String) -> Self { - return Self { - paths: vec![], - ends_with: "".to_string(), - path - } - } - pub fn fetch(&mut self) -> Result, String> { if let Err(error) = self.read_dir(self.path.clone()) { return Err(error); diff --git a/src/app/mod.rs b/src/app/mod.rs index 9c4bca5..88f70ff 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1,6 +1,5 @@ mod commands; pub mod builder; -pub mod rx; pub mod fs_util; use std::collections::HashMap; diff --git a/src/app/rx/mod.rs b/src/app/rx/mod.rs deleted file mode 100644 index 6b68012..0000000 --- a/src/app/rx/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -type Subscriber = fn(value: T) -> (); - -pub struct Observable { - subscriber: Vec> -} - -impl Observable { - - pub fn new() -> Observable { - return Observable { - subscriber: Vec::new(), - } - } - - pub fn next(&self, value: T) { - for callback in &self.subscriber { - callback(value); - } - } - - pub fn subscribe(&mut self, subscriber: Subscriber) { - self.subscriber.push(subscriber); - } -}