code cleanup

This commit is contained in:
2023-01-24 22:35:00 +01:00
parent 26781cd810
commit 1d2128ca15
4 changed files with 1 additions and 35 deletions

View File

@@ -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;

View File

@@ -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<Vec<String>, String> {
if let Err(error) = self.read_dir(self.path.clone()) {
return Err(error);

View File

@@ -1,6 +1,5 @@
mod commands;
pub mod builder;
pub mod rx;
pub mod fs_util;
use std::collections::HashMap;

View File

@@ -1,24 +0,0 @@
type Subscriber<T> = fn(value: T) -> ();
pub struct Observable<T: Copy> {
subscriber: Vec<Subscriber<T>>
}
impl<T: Copy> Observable<T> {
pub fn new() -> Observable<T> {
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<T>) {
self.subscriber.push(subscriber);
}
}