Skip to content

Commit

Permalink
Remove test function
Browse files Browse the repository at this point in the history
  • Loading branch information
MattHalpinParity committed Jul 29, 2024
1 parent b4b7375 commit cd3b0ff
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ fn mmap(file: &std::fs::File, _len: usize) -> Result<memmap2::MmapMut> {

const GROW_SIZE_BYTES: u64 = 256 * 1024;

fn test_metadata<P: AsRef<std::path::Path>>(path: P) -> std::io::Result<std::fs::Metadata> {
std::fs::metadata(path)
//Err(std::io::Error::new(ErrorKind::NotFound, "Test NotFound error"))
//Err(std::io::Error::new(ErrorKind::PermissionDenied, "Test other error"))
}

#[derive(Debug)]
pub struct TableFile {
pub map: RwLock<Option<(memmap2::MmapMut, std::fs::File)>>,
Expand All @@ -102,7 +96,7 @@ pub struct TableFile {
impl TableFile {
pub fn open(filepath: std::path::PathBuf, entry_size: u16, id: TableId) -> Result<Self> {
let mut capacity = 0u64;
let map = if let Err(error) = test_metadata(&filepath) {
let map = if let Err(error) = std::fs::metadata(&filepath) {
match error.kind() {
std::io::ErrorKind::NotFound => None,
_ => return try_io!(Err(error)),
Expand Down

0 comments on commit cd3b0ff

Please sign in to comment.