Skip to content

Commit aa2381d

Browse files
committed
Fix rustdoc examples
1 parent 1e3b24d commit aa2381d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_lints/src/swap.rs

+2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ enum Slice<'a> {
168168
/// ## Example
169169
///
170170
/// ```rust
171+
/// # let mut a = vec![0, 1];
171172
/// let t = a[1];
172173
/// a[1] = a[0];
173174
/// a[0] = t;
@@ -180,6 +181,7 @@ enum Slice<'a> {
180181
/// ## Example
181182
///
182183
/// ```rust
184+
/// # let mut a = [vec![1, 2], vec![3, 4]];
183185
/// let t = a[0][1];
184186
/// a[0][1] = a[1][0];
185187
/// a[1][0] = t;

0 commit comments

Comments
 (0)