Skip to content

Commit

Permalink
style: conforms common::split module structure to follow repository s…
Browse files Browse the repository at this point in the history
…tandards
  • Loading branch information
arindas committed Feb 8, 2024
1 parent ed3faf2 commit 0084f4a
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/common/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,23 @@ impl<T> SplitAt<T> for Vec<T> {
}
}

#[cfg(target_os = "linux")]
pub mod glommio_impl {
//! Module containing [`super::SplitAt`] implementations for [`glommio`] specific types.
use glommio::io::ReadResult;
pub mod impls {
//! Module providing [`SplitAt`](super::SplitAt) implementations.
use super::SplitAt;
#[cfg(target_os = "linux")]
pub mod glommio {
//! Module containing [`SplitAt`] implementations for [`glommio`](https://docs.rs/glommio) specific types.
use glommio::io::ReadResult;

impl SplitAt<u8> for ReadResult {
fn split_at(self, at: usize) -> Option<(Self, Self)> {
Some((
ReadResult::slice(&self, 0, at)?,
ReadResult::slice(&self, at, self.len() - at)?,
))
use super::super::SplitAt;

impl SplitAt<u8> for ReadResult {
fn split_at(self, at: usize) -> Option<(Self, Self)> {
Some((
ReadResult::slice(&self, 0, at)?,
ReadResult::slice(&self, at, self.len() - at)?,
))
}
}
}
}

0 comments on commit 0084f4a

Please sign in to comment.