Skip to content

Commit a29b503

Browse files
author
Jethro Beekman
committed
Add stable example to TypeId
1 parent e011175 commit a29b503

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libcore/any.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,10 @@ impl TypeId {
351351
/// # Examples
352352
///
353353
/// ```
354-
/// #![feature(get_type_id)]
355-
///
356354
/// use std::any::{Any, TypeId};
357355
///
358-
/// fn is_string(s: &Any) -> bool {
359-
/// TypeId::of::<String>() == s.get_type_id()
356+
/// fn is_string<T: ?Sized + Any>(_s: &T) -> bool {
357+
/// TypeId::of::<String>() == TypeId::of::<T>()
360358
/// }
361359
///
362360
/// fn main() {

0 commit comments

Comments
 (0)