Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
These were implemented early on since I thought I'd need them later, but it turned out they were unncessary.
  • Loading branch information
ObsidianMinor committed Aug 4, 2024
1 parent 7b38bb8 commit f8c680c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
5 changes: 0 additions & 5 deletions recapn/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,6 @@ impl<'b, 'p, T: Table, V: ty::Value> PtrVariantBuilder<'b, 'p, T, V> {
self.is_set().then(|| unsafe { self.repr.ptr_field_mut_unchecked(self.descriptor.slot as u16) })
}

#[inline]
fn into_raw_build_ptr(self) -> Option<ptr::PtrBuilder<'b, T>> {
self.is_set().then(|| unsafe { self.repr.ptr_field_mut_unchecked(self.descriptor.slot as u16) })
}

#[inline]
pub fn init_field(self) -> PtrFieldBuilder<'b, 'p, T, V> {
if !self.is_set() {
Expand Down
18 changes: 0 additions & 18 deletions recapn/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ pub(crate) mod internal {
pub trait CapPtrReader: Clone {
type Table: Table;
type Cap;

fn read_cap(&self, index: u32) -> Result<Self::Cap>;
}

pub trait CapPtrBuilder: CapPtrReader {
fn set_cap(&self, cap: Self::Cap) -> Result<Option<u32>>;
fn clear_cap(&self, index: u32) -> Result<()>;
fn as_reader(&self) -> <Self::Table as Table>::Reader;
}
Expand All @@ -35,16 +32,9 @@ pub(crate) mod internal {
impl CapPtrReader for Empty {
type Table = Empty;
type Cap = Infallible;

fn read_cap(&self, _: u32) -> Result<Infallible> {
Err(ErrorKind::CapabilityNotAllowed.into())
}
}

impl CapPtrBuilder for Empty {
fn set_cap(&self, cap: Infallible) -> Result<Option<u32>> {
match cap {}
}
fn clear_cap(&self, _: u32) -> Result<()> {
Err(ErrorKind::CapabilityNotAllowed.into())
}
Expand Down Expand Up @@ -89,17 +79,9 @@ pub(crate) mod internal {
impl<T: CapTableReader> CapPtrReader for T {
type Table = T::System;
type Cap = <T::System as CapSystem>::Cap;

fn read_cap(&self, index: u32) -> Result<Self::Cap> {
self.extract_cap(index)
.ok_or(ErrorKind::InvalidCapabilityPointer(index).into())
}
}

impl<T: CapTableBuilder> CapPtrBuilder for T {
fn set_cap(&self, cap: Self::Cap) -> Result<Option<u32>> {
Ok(self.inject_cap(cap))
}
fn clear_cap(&self, index: u32) -> Result<()> {
self.drop_cap(index);
Ok(())
Expand Down
4 changes: 0 additions & 4 deletions recapn/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ impl<'a> Reader<'a> {
Self::from_slice(EMPTY_SLICE)
}

pub(crate) const fn new_unchecked(blob: ptr::Reader<'a>) -> Self {
Self(blob)
}

/// Interprets a given blob reader as text. This requires that the blob has at least one byte
/// and that the last byte is empty.
#[inline]
Expand Down

0 comments on commit f8c680c

Please sign in to comment.