Skip to content

Commit 432a3bc

Browse files
authored
Merge pull request #19553 from davidbarsky/davidbarsky/fix-rustdoc-tests
internal: fix `NameGenerator`'s and `AnyMap`'s rustdocs
2 parents a556f72 + 3e15dbc commit 432a3bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/ide-db/src/syntax_helpers/suggest_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const USELESS_METHODS: &[&str] = &[
8383
///
8484
/// ```
8585
/// # use ide_db::syntax_helpers::suggest_name::NameGenerator;
86-
/// let mut generator = NameGenerator::new();
86+
/// let mut generator = NameGenerator::default();
8787
/// assert_eq!(generator.suggest_name("a"), "a");
8888
/// assert_eq!(generator.suggest_name("a"), "a1");
8989
///

crates/stdx/src/anymap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ pub type RawMap<A> = hash_map::HashMap<TypeId, Box<A>, BuildHasherDefault<TypeId
8282
/// ## Example
8383
///
8484
/// (Here, the [`AnyMap`] convenience alias is used;
85-
/// the first line could use `[anymap::Map][Map]::<[core::any::Any]>::new()`
85+
/// the first line could use `[anymap::Map][Map]::<[core::any::Any]>::default()`
8686
/// instead if desired.)
8787
///
8888
/// ```
8989
/// # use stdx::anymap;
90-
/// let mut data = anymap::AnyMap::new();
90+
/// let mut data = anymap::AnyMap::default();
9191
/// assert_eq!(data.get(), None::<&i32>);
9292
/// ```
9393
///
@@ -100,7 +100,7 @@ pub struct Map<A: ?Sized + Downcast = dyn Any> {
100100
/// The most common type of `Map`: just using `Any`; `[Map]<dyn [Any]>`.
101101
///
102102
/// Why is this a separate type alias rather than a default value for `Map<A>`?
103-
/// `Map::new()` doesn't seem to be happy to infer that it should go with the default
103+
/// `Map::default()` doesn't seem to be happy to infer that it should go with the default
104104
/// value. It's a bit sad, really. Ah well, I guess this approach will do.
105105
pub type AnyMap = Map<dyn Any>;
106106

0 commit comments

Comments
 (0)