File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,14 @@ pub const fn identity<T>(x: T) -> T {
150
150
/// follows:
151
151
///
152
152
/// ```
153
+ /// # use core::ops::Deref;
154
+ /// # struct SomeType;
155
+ /// # impl Deref for SomeType {
156
+ /// # type Target = [u8];
157
+ /// # fn deref(&self) -> &[u8] {
158
+ /// # &[]
159
+ /// # }
160
+ /// # }
153
161
/// impl<T> AsRef<T> for SomeType
154
162
/// where
155
163
/// T: ?Sized,
@@ -245,6 +253,19 @@ pub trait AsRef<T: ?Sized> {
245
253
/// implementation of `AsMut` as follows:
246
254
///
247
255
/// ```
256
+ /// # use core::ops::{Deref, DerefMut};
257
+ /// # struct SomeType;
258
+ /// # impl Deref for SomeType {
259
+ /// # type Target = [u8];
260
+ /// # fn deref(&self) -> &[u8] {
261
+ /// # &[]
262
+ /// # }
263
+ /// # }
264
+ /// # impl DerefMut for SomeType {
265
+ /// # fn deref_mut(&mut self) -> &mut [u8] {
266
+ /// # &mut []
267
+ /// # }
268
+ /// # }
248
269
/// impl<T> AsMut<T> for SomeType
249
270
/// where
250
271
/// <SomeType as Deref>::Target: AsMut<T>,
You can’t perform that action at this time.
0 commit comments