Skip to content

Commit

Permalink
Add feature annotation to docs of Channel::send_vectored()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillikin committed Aug 21, 2020
1 parent ced54bb commit d093303
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions fuse/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ use std::io::{self, IoSlice, Read, Write};

use crate::error::{Error, ErrorCode};

#[cfg(feature = "nightly_impl_channel")]
#[cfg(any(doc, feature = "nightly_impl_channel"))]
pub trait Channel {
type Error: ChannelError;

fn send(&self, buf: &[u8]) -> Result<(), Self::Error>;

#[cfg_attr(doc, doc(cfg(feature = "nightly_impl_channel")))]
fn send_vectored<const N: usize>(
&self,
bufs: &[&[u8]; N],
Expand All @@ -47,7 +48,7 @@ pub(crate) mod private {
}
}

#[cfg(not(feature = "nightly_impl_channel"))]
#[cfg(not(any(doc, feature = "nightly_impl_channel")))]
pub trait Channel:
private::ChannelNoConstGenerics<<Self as Channel>::Error>
{
Expand Down Expand Up @@ -163,7 +164,8 @@ impl Channel for FileChannel {
Ok(())
}

#[cfg(feature = "nightly_impl_channel")]
#[cfg(any(doc, feature = "nightly_impl_channel"))]

fn send_vectored<const N: usize>(
&self,
bufs: &[&[u8]; N],
Expand Down
5 changes: 4 additions & 1 deletion fuse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@

// For `send_vectored` in `fuse/src/channel.rs`.
#![allow(incomplete_features)]
#![cfg_attr(feature = "nightly_impl_channel", feature(const_generics))]
#![cfg_attr(any(
doc,
feature = "nightly_impl_channel",
), feature(const_generics))]

#[cfg(feature = "libc_fuse_mount")]
extern crate libc;
Expand Down
2 changes: 1 addition & 1 deletion fuse/src/os/linux/dev_cuse_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl channel::Channel for DevCuseChannel {
self.0.send(buf)
}

#[cfg(feature = "nightly_impl_channel")]
#[cfg(any(doc, feature = "nightly_impl_channel"))]
fn send_vectored<const N: usize>(
&self,
bufs: &[&[u8]; N],
Expand Down
2 changes: 1 addition & 1 deletion fuse/src/os/linux/dev_fuse_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl channel::Channel for DevFuseChannel {
self.0.send(buf)
}

#[cfg(feature = "nightly_impl_channel")]
#[cfg(any(doc, feature = "nightly_impl_channel"))]
fn send_vectored<const N: usize>(
&self,
bufs: &[&[u8]; N],
Expand Down

0 comments on commit d093303

Please sign in to comment.