Skip to content

Commit

Permalink
Added doc links to the relevant trait to new functions and modules cr…
Browse files Browse the repository at this point in the history
…eated by the macro
  • Loading branch information
tomBoddaert committed Sep 15, 2023
1 parent 187a1e3 commit 3714998
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dyn-slice"
version = "3.0.1"
version = "3.0.2"
authors = ["Tom Boddaert"]
edition = "2021"
description = "&dyn [Trait] implementation, inspired by a Reddit thread."
Expand Down
6 changes: 3 additions & 3 deletions lib/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ macro_rules! declare_new_fn {
$tr:path $( :<$( $trgen:ident ),*> )?,
$vis:vis $name:ident $(,)?
) => {
#[doc = concat!("new functions for `&dyn [", stringify!($tr), "]`")]
#[doc = concat!("new functions for `&dyn [`[`", stringify!($tr), "`]`]`")]
$(#[ $meta ])*
$vis mod $name {
#[allow(unused_imports)]
Expand All @@ -109,7 +109,7 @@ macro_rules! declare_new_fn {

#[allow(unused)]
#[must_use]
/// Create a dyn slice from a slice
#[doc = concat!("Create a dyn slice from a slice of a type that implements [`", stringify!($tr), "`]")]
pub fn new<'a, $($( $gen ,)*)? DynSliceFromType: Trait $(< $($trgen),* >)? + 'static>(value: &'a [DynSliceFromType]) -> $crate::DynSlice<dyn Trait $(< $($trgen),* >)?>
where
dyn Trait $(< $($trgen),* >)?: core::ptr::Pointee<Metadata = core::ptr::DynMetadata<dyn Trait $(< $($trgen),* >)?>>,
Expand Down Expand Up @@ -141,7 +141,7 @@ macro_rules! declare_new_fn {

#[allow(unused)]
#[must_use]
/// Create a mutable dyn slice from a mutable slice
#[doc = concat!("Create a mutable dyn slice from a mutable slice of a type that implements [`", stringify!($tr), "`]")]
pub fn new_mut<'a, $($( $gen ,)*)? DynSliceFromType: Trait $(< $($trgen),* >)? + 'static>(value: &'a mut [DynSliceFromType]) -> $crate::DynSliceMut<dyn Trait $(< $($trgen),* >)?>
where
dyn Trait $(< $($trgen),* >)?: core::ptr::Pointee<Metadata = core::ptr::DynMetadata<dyn Trait $(< $($trgen),* >)?>>,
Expand Down

0 comments on commit 3714998

Please sign in to comment.