Skip to content

Commit

Permalink
Rollup merge of rust-lang#37240 - jethrogb:typeid_doc, r=sfackler
Browse files Browse the repository at this point in the history
Add stable example to TypeId

The old example is still available at [Any::get_type_id](https://doc.rust-lang.org/std/any/trait.Any.html#examples)
  • Loading branch information
eddyb authored Oct 19, 2016
2 parents ad241df + a29b503 commit 3d57d42
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,10 @@ impl TypeId {
/// # Examples
///
/// ```
/// #![feature(get_type_id)]
///
/// use std::any::{Any, TypeId};
///
/// fn is_string(s: &Any) -> bool {
/// TypeId::of::<String>() == s.get_type_id()
/// fn is_string<T: ?Sized + Any>(_s: &T) -> bool {
/// TypeId::of::<String>() == TypeId::of::<T>()
/// }
///
/// fn main() {
Expand Down

0 comments on commit 3d57d42

Please sign in to comment.