Skip to content

Commit 49749e7

Browse files
committed
Fix documentation compilability.
1 parent 86e18e0 commit 49749e7

File tree

2 files changed

+1
-80
lines changed

2 files changed

+1
-80
lines changed

lightning/src/lib.rs

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -165,50 +165,16 @@ pub mod io {
165165
/// Cursor initial position is `0` even if underlying buffer (e.g., [`Vec`])
166166
/// is not empty. So writing to cursor starts with overwriting [`Vec`]
167167
/// content, not with appending to it.
168-
///
169-
/// # Examples
170-
///
171-
/// ```
172-
/// use bitcoin::io::Cursor;
173-
///
174-
/// let buff = Cursor::new(Vec::new());
175-
/// # fn force_inference(_: &Cursor<Vec<u8>>) {}
176-
/// # force_inference(&buff);
177-
/// ```
178168
pub fn new(inner: T) -> Cursor<T> {
179169
Cursor { pos: 0, inner }
180170
}
181171

182172
/// Consumes this cursor, returning the underlying value.
183-
///
184-
/// # Examples
185-
///
186-
/// ```
187-
/// use bitcoin::io::Cursor;
188-
///
189-
/// let buff = Cursor::new(Vec::new());
190-
/// # fn force_inference(_: &Cursor<Vec<u8>>) {}
191-
/// # force_inference(&buff);
192-
///
193-
/// let vec = buff.into_inner();
194-
/// ```
195173
pub fn into_inner(self) -> T {
196174
self.inner
197175
}
198176

199177
/// Gets a reference to the underlying value in this cursor.
200-
///
201-
/// # Examples
202-
///
203-
/// ```
204-
/// use bitcoin::io::Cursor;
205-
///
206-
/// let buff = Cursor::new(Vec::new());
207-
/// # fn force_inference(_: &Cursor<Vec<u8>>) {}
208-
/// # force_inference(&buff);
209-
///
210-
/// let reference = buff.get_ref();
211-
/// ```
212178
pub fn get_ref(&self) -> &T {
213179
&self.inner
214180
}
@@ -217,61 +183,16 @@ pub mod io {
217183
///
218184
/// Care should be taken to avoid modifying the internal I/O state of the
219185
/// underlying value as it may corrupt this cursor's position.
220-
///
221-
/// # Examples
222-
///
223-
/// ```
224-
/// use bitcoin::io::Cursor;
225-
///
226-
/// let mut buff = Cursor::new(Vec::new());
227-
/// # fn force_inference(_: &Cursor<Vec<u8>>) {}
228-
/// # force_inference(&buff);
229-
///
230-
/// let reference = buff.get_mut();
231-
/// ```
232186
pub fn get_mut(&mut self) -> &mut T {
233187
&mut self.inner
234188
}
235189

236190
/// Returns the current position of this cursor.
237-
///
238-
/// # Examples
239-
///
240-
/// ```
241-
/// use core2::io::{Cursor, Seek, SeekFrom};
242-
/// use std::io::prelude::*;
243-
///
244-
/// let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]);
245-
///
246-
/// assert_eq!(buff.position(), 0);
247-
///
248-
/// buff.seek(SeekFrom::Current(2)).unwrap();
249-
/// assert_eq!(buff.position(), 2);
250-
///
251-
/// buff.seek(SeekFrom::Current(-1)).unwrap();
252-
/// assert_eq!(buff.position(), 1);
253-
/// ```
254191
pub fn position(&self) -> u64 {
255192
self.pos
256193
}
257194

258195
/// Sets the position of this cursor.
259-
///
260-
/// # Examples
261-
///
262-
/// ```
263-
/// use core2::io::Cursor;
264-
///
265-
/// let mut buff = Cursor::new(vec![1, 2, 3, 4, 5]);
266-
///
267-
/// assert_eq!(buff.position(), 0);
268-
///
269-
/// buff.set_position(2);
270-
/// assert_eq!(buff.position(), 2);
271-
///
272-
/// buff.set_position(4);
273-
/// assert_eq!(buff.position(), 4);
274-
/// ```
275196
pub fn set_position(&mut self, pos: u64) {
276197
self.pos = pos;
277198
}

lightning/src/util/ser_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ macro_rules! _decode_tlv_stream_match_check {
456456
/// For example,
457457
/// ```
458458
/// # use lightning::decode_tlv_stream;
459-
/// # fn read<R: lightning::io::Read> (stream: R) -> Result<(), lightning::ln::msgs::DecodeError> {
459+
/// # fn read<R: lightning::io::Read> (stream: &mut R) -> Result<(), lightning::ln::msgs::DecodeError> {
460460
/// let mut required_value = 0u64;
461461
/// let mut optional_value: Option<u64> = None;
462462
/// decode_tlv_stream!(stream, {

0 commit comments

Comments
 (0)