Skip to content

Commit 87c3d7b

Browse files
committed
Fix up Any doc examples
Make the Any+Send+Sync examples use the right trait bounds, and fix a small whitespace issue.
1 parent 0c7bf56 commit 87c3d7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/libcore/any.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl Any+Send {
308308
/// ```
309309
/// use std::any::Any;
310310
///
311-
/// fn modify_if_u32(s: &mut (Any+ Send)) {
311+
/// fn modify_if_u32(s: &mut (Any + Send)) {
312312
/// if let Some(num) = s.downcast_mut::<u32>() {
313313
/// *num = 42;
314314
/// }
@@ -366,7 +366,7 @@ impl Any+Send+Sync {
366366
/// ```
367367
/// use std::any::Any;
368368
///
369-
/// fn print_if_string(s: &(Any + Send)) {
369+
/// fn print_if_string(s: &(Any + Send + Sync)) {
370370
/// if let Some(string) = s.downcast_ref::<String>() {
371371
/// println!("It's a string({}): '{}'", string.len(), string);
372372
/// } else {
@@ -392,7 +392,7 @@ impl Any+Send+Sync {
392392
/// ```
393393
/// use std::any::Any;
394394
///
395-
/// fn modify_if_u32(s: &mut (Any+ Send)) {
395+
/// fn modify_if_u32(s: &mut (Any + Send + Sync)) {
396396
/// if let Some(num) = s.downcast_mut::<u32>() {
397397
/// *num = 42;
398398
/// }

0 commit comments

Comments
 (0)