From ee45375085cc505675a6e5534829b76f56f4cb5b Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 26 Mar 2023 09:30:42 -0400 Subject: [PATCH] Removed session as separate code. --- src/morethantext/entry.rs | 12 +++++++++--- src/morethantext/mod.rs | 19 ------------------- src/morethantext/session.rs | 17 ----------------- 3 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 src/morethantext/session.rs diff --git a/src/morethantext/entry.rs b/src/morethantext/entry.rs index ba81676..f92f9aa 100644 --- a/src/morethantext/entry.rs +++ b/src/morethantext/entry.rs @@ -1,6 +1,12 @@ -use async_std::{fs::{read, remove_file, write}, path::PathBuf}; -use super::{DataType, DBError, ErrorCode, FileData, SessionData}; -use std::{cell::Cell, time::{Duration, Instant}}; +use super::{DBError, DataType, ErrorCode, FileData, SessionData}; +use async_std::{ + fs::{read, remove_file, write}, + path::PathBuf, +}; +use std::{ + cell::Cell, + time::{Duration, Instant}, +}; pub struct Entry { data: DataType, diff --git a/src/morethantext/mod.rs b/src/morethantext/mod.rs index 6f03b11..1ef1637 100644 --- a/src/morethantext/mod.rs +++ b/src/morethantext/mod.rs @@ -1,14 +1,12 @@ mod database; mod entry; mod error; -mod session; mod store; use async_std::path::PathBuf; use database::Database; use entry::Entry; use error::{DBError, ErrorCode}; -use session::Session; use std::{slice, str}; use store::Store; @@ -134,10 +132,6 @@ impl MoreThanText { } } } - - fn new_session(&self) -> Session { - Session::new() - } } #[cfg(test)] @@ -367,16 +361,3 @@ mod create { } } } - -#[cfg(test)] -mod sessions { - use super::*; - use tempfile::tempdir; - - #[async_std::test] - async fn create_session() { - let dir = tempdir().unwrap(); - let mtt = MoreThanText::new(dir.path().to_str().unwrap()).await.unwrap(); - mtt.new_session(); - } -} diff --git a/src/morethantext/session.rs b/src/morethantext/session.rs deleted file mode 100644 index beb9602..0000000 --- a/src/morethantext/session.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub struct Session; - -impl Session { - pub fn new() -> Self { - Self {} - } -} - -#[cfg(test)] -mod session { - use super::*; - - #[test] - fn create() { - Session::new(); - } -}