Skip to content

Commit 738c017

Browse files
committed
remove as_any
1 parent b356ca2 commit 738c017

4 files changed

Lines changed: 0 additions & 18 deletions

File tree

src/directory/directory.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::any::Any;
21
use std::collections::HashSet;
32
use std::io::Write;
43
use std::path::{Path, PathBuf};
@@ -113,8 +112,6 @@ pub type DirectoryPanicHandler = Arc<dyn Fn(Box<dyn Any + Send>) + Send + Sync +
113112
/// - The [`MMapDirectory`][crate::directory::MmapDirectory], this should be your default choice.
114113
/// - The [`RamDirectory`][crate::directory::RamDirectory], which should be used mostly for tests.
115114
pub trait Directory: DirectoryClone + fmt::Debug + Send + Sync + 'static {
116-
fn as_any(&self) -> &dyn Any;
117-
118115
/// Opens a file and returns a boxed `FileHandle`.
119116
///
120117
/// Users of `Directory` should typically call `Directory::open_read(...)`,

src/directory/managed_directory.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::any::Any;
21
use std::collections::HashSet;
32
use std::io::Write;
43
use std::path::{Path, PathBuf};
@@ -294,10 +293,6 @@ impl ManagedDirectory {
294293
}
295294

296295
impl Directory for ManagedDirectory {
297-
fn as_any(&self) -> &dyn Any {
298-
self
299-
}
300-
301296
fn get_file_handle(&self, path: &Path) -> Result<Arc<dyn FileHandle>, OpenReadError> {
302297
let file_slice = self.open_read(path)?;
303298
Ok(Arc::new(file_slice))

src/directory/mmap_directory.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::any::Any;
21
use std::collections::HashMap;
32
use std::fmt;
43
use std::fs::{self, File, OpenOptions};
@@ -369,10 +368,6 @@ pub(crate) fn atomic_write(path: &Path, content: &[u8]) -> io::Result<()> {
369368
}
370369

371370
impl Directory for MmapDirectory {
372-
fn as_any(&self) -> &dyn Any {
373-
self
374-
}
375-
376371
fn get_file_handle(&self, path: &Path) -> Result<Arc<dyn FileHandle>, OpenReadError> {
377372
debug!("Open Read {:?}", path);
378373
let full_path = self.resolve_path(path);

src/directory/ram_directory.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::any::Any;
21
use std::collections::HashMap;
32
use std::io::{self, BufWriter, Cursor, Write};
43
use std::path::{Path, PathBuf};
@@ -168,10 +167,6 @@ impl RamDirectory {
168167
}
169168

170169
impl Directory for RamDirectory {
171-
fn as_any(&self) -> &dyn Any {
172-
self
173-
}
174-
175170
fn get_file_handle(&self, path: &Path) -> Result<Arc<dyn FileHandle>, OpenReadError> {
176171
let file_slice = self.open_read(path)?;
177172
Ok(Arc::new(file_slice))

0 commit comments

Comments
 (0)