Skip to content

Commit

Permalink
Fix up Any doc examples
Browse files Browse the repository at this point in the history
Make the Any+Send+Sync examples use the right trait bounds, and fix a small whitespace issue.
  • Loading branch information
jsgf committed May 31, 2018
1 parent 0c7bf56 commit 87c3d7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libcore/any.rs
Expand Up @@ -308,7 +308,7 @@ impl Any+Send {
/// ```
/// use std::any::Any;
///
/// fn modify_if_u32(s: &mut (Any+ Send)) {
/// fn modify_if_u32(s: &mut (Any + Send)) {
/// if let Some(num) = s.downcast_mut::<u32>() {
/// *num = 42;
/// }
Expand Down Expand Up @@ -366,7 +366,7 @@ impl Any+Send+Sync {
/// ```
/// use std::any::Any;
///
/// fn print_if_string(s: &(Any + Send)) {
/// fn print_if_string(s: &(Any + Send + Sync)) {
/// if let Some(string) = s.downcast_ref::<String>() {
/// println!("It's a string({}): '{}'", string.len(), string);
/// } else {
Expand All @@ -392,7 +392,7 @@ impl Any+Send+Sync {
/// ```
/// use std::any::Any;
///
/// fn modify_if_u32(s: &mut (Any+ Send)) {
/// fn modify_if_u32(s: &mut (Any + Send + Sync)) {
/// if let Some(num) = s.downcast_mut::<u32>() {
/// *num = 42;
/// }
Expand Down

0 comments on commit 87c3d7b

Please sign in to comment.