Removed session as separate code.
This commit is contained in:
		@@ -1,6 +1,12 @@
 | 
				
			|||||||
use async_std::{fs::{read, remove_file, write}, path::PathBuf};
 | 
					use super::{DBError, DataType, ErrorCode, FileData, SessionData};
 | 
				
			||||||
use super::{DataType, DBError, ErrorCode, FileData, SessionData};
 | 
					use async_std::{
 | 
				
			||||||
use std::{cell::Cell, time::{Duration, Instant}};
 | 
					    fs::{read, remove_file, write},
 | 
				
			||||||
 | 
					    path::PathBuf,
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					use std::{
 | 
				
			||||||
 | 
					    cell::Cell,
 | 
				
			||||||
 | 
					    time::{Duration, Instant},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub struct Entry {
 | 
					pub struct Entry {
 | 
				
			||||||
    data: DataType,
 | 
					    data: DataType,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,14 +1,12 @@
 | 
				
			|||||||
mod database;
 | 
					mod database;
 | 
				
			||||||
mod entry;
 | 
					mod entry;
 | 
				
			||||||
mod error;
 | 
					mod error;
 | 
				
			||||||
mod session;
 | 
					 | 
				
			||||||
mod store;
 | 
					mod store;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use async_std::path::PathBuf;
 | 
					use async_std::path::PathBuf;
 | 
				
			||||||
use database::Database;
 | 
					use database::Database;
 | 
				
			||||||
use entry::Entry;
 | 
					use entry::Entry;
 | 
				
			||||||
use error::{DBError, ErrorCode};
 | 
					use error::{DBError, ErrorCode};
 | 
				
			||||||
use session::Session;
 | 
					 | 
				
			||||||
use std::{slice, str};
 | 
					use std::{slice, str};
 | 
				
			||||||
use store::Store;
 | 
					use store::Store;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -134,10 +132,6 @@ impl MoreThanText {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    fn new_session(&self) -> Session {
 | 
					 | 
				
			||||||
        Session::new()
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[cfg(test)]
 | 
					#[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();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user