Skip to content

Commit

Permalink
Cleanup comment out code
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Sep 15, 2024
1 parent 45494eb commit 43ce896
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ ignore:
- "**/integration/"
- "**/examples/"
- "**/benches/"
- "src/tests.rs"
- "src/error.rs"
- "src/swmr/generic/traits/impls/"
- "src/swmr/generic/traits/impls.rs"
- "src/tests.rs"
- "src/swmr/generic/tests.rs"
- "src/swmr/generic/tests/"
- "src/swmr/wal/tests.rs"
Expand Down
3 changes: 2 additions & 1 deletion src/swmr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod wal;
/// The ordered write-ahead log only supports bytes.
pub mod wal;
pub use wal::OrderWal;

/// The generic implementation of the ordered write-ahead log.
Expand Down
1 change: 0 additions & 1 deletion src/swmr/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,6 @@ where
requested,
available,
} => error::Error::insufficient_space(requested, available),
ArenaError::ReadOnly => error::Error::read_only(),
_ => unreachable!(),
};
Err(Among::Right(e))
Expand Down
2 changes: 1 addition & 1 deletion src/swmr/generic/traits/impls/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<'a> TypeRef<'a> for &'a [u8] {
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SliceRef<'a>(&'a [u8]);

impl<'a> Borrow<[u8]> for SliceRef<'a> {
impl Borrow<[u8]> for SliceRef<'_> {
fn borrow(&self) -> &[u8] {
self.0
}
Expand Down
19 changes: 12 additions & 7 deletions src/swmr/wal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub use iter::*;
))]
mod tests;

#[doc(hidden)]
pub struct OrderWalCore<C, S> {
arena: Arena,
map: SkipSet<Pointer<C>>,
Expand Down Expand Up @@ -146,7 +147,6 @@ where
requested,
available,
} => error::Error::insufficient_space(requested, available),
ArenaError::ReadOnly => error::Error::read_only(),
_ => unreachable!(),
};
Err(Among::Right(e))
Expand Down Expand Up @@ -213,13 +213,18 @@ where
}

impl<C, S> OrderWal<C, S> {
// /// Returns the read-only view for the WAL.
// #[inline]
// pub fn reader(&self) -> OrderWalReader<C, S> {
// OrderWalReader::new(self.core.clone())
// }

/// Returns the path of the WAL if it is backed by a file.
///
/// # Example
///
/// ```rust
/// use orderwal::{swmr::OrderWal, Wal, Builder};
///
/// // A in-memory WAL
/// let wal = OrderWal::new(Builder::new().with_capacity(100)).unwrap();
///
/// assert!(wal.path_buf().is_none());
/// ```
pub fn path_buf(&self) -> Option<&std::sync::Arc<std::path::PathBuf>> {
self.core.arena.path()
}
Expand Down
12 changes: 11 additions & 1 deletion src/unsync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ where

impl<C, S> OrderWal<C, S> {
/// Returns the path of the WAL if it is backed by a file.
///
/// # Example
///
/// ```rust
/// use orderwal::{unsync::OrderWal, Wal, Builder};
///
/// // A in-memory WAL
/// let wal = OrderWal::new(Builder::new().with_capacity(100)).unwrap();
///
/// assert!(wal.path_buf().is_none());
/// ```
pub fn path_buf(&self) -> Option<&std::rc::Rc<std::path::PathBuf>> {
self.core().arena.path()
}
Expand Down Expand Up @@ -117,7 +128,6 @@ where
requested,
available,
} => error::Error::insufficient_space(requested, available),
ArenaError::ReadOnly => error::Error::read_only(),
_ => unreachable!(),
};
Err(Among::Right(e))
Expand Down

0 comments on commit 43ce896

Please sign in to comment.