diff --git a/crates/ide-db/src/syntax_helpers/suggest_name.rs b/crates/ide-db/src/syntax_helpers/suggest_name.rs index 51ce9b4829..5e68ccd3d3 100644 --- a/crates/ide-db/src/syntax_helpers/suggest_name.rs +++ b/crates/ide-db/src/syntax_helpers/suggest_name.rs @@ -83,7 +83,7 @@ const USELESS_METHODS: &[&str] = &[ /// /// ``` /// # use ide_db::syntax_helpers::suggest_name::NameGenerator; -/// let mut generator = NameGenerator::new(); +/// let mut generator = NameGenerator::default(); /// assert_eq!(generator.suggest_name("a"), "a"); /// assert_eq!(generator.suggest_name("a"), "a1"); /// diff --git a/crates/stdx/src/anymap.rs b/crates/stdx/src/anymap.rs index f55698ecb0..a3f6ab8951 100644 --- a/crates/stdx/src/anymap.rs +++ b/crates/stdx/src/anymap.rs @@ -82,12 +82,12 @@ pub type RawMap = hash_map::HashMap, BuildHasherDefault::new()` +/// the first line could use `[anymap::Map][Map]::<[core::any::Any]>::default()` /// instead if desired.) /// /// ``` /// # use stdx::anymap; -/// let mut data = anymap::AnyMap::new(); +/// let mut data = anymap::AnyMap::default(); /// assert_eq!(data.get(), None::<&i32>); /// ``` /// @@ -100,7 +100,7 @@ pub struct Map { /// The most common type of `Map`: just using `Any`; `[Map]`. /// /// Why is this a separate type alias rather than a default value for `Map`? -/// `Map::new()` doesn't seem to be happy to infer that it should go with the default +/// `Map::default()` doesn't seem to be happy to infer that it should go with the default /// value. It's a bit sad, really. Ah well, I guess this approach will do. pub type AnyMap = Map;