diff options
| author | David Barsky <me@davidbarsky.com> | 2025-04-09 16:56:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-09 16:56:31 +0000 |
| commit | d711d0a19a834fc4aa31946bf86d86f8eb8569f0 (patch) | |
| tree | e55562b368a8a2530dd95a8f2878578b78ed661c /src/tools/rust-analyzer | |
| parent | 9e02bc5a9b65ca6b300224ea812bda791e31c1d4 (diff) | |
| parent | 5697022c7746d699c5950c865890cff4b8f973db (diff) | |
| download | rust-d711d0a19a834fc4aa31946bf86d86f8eb8569f0.tar.gz rust-d711d0a19a834fc4aa31946bf86d86f8eb8569f0.zip | |
Merge pull request #19553 from davidbarsky/davidbarsky/fix-rustdoc-tests
internal: fix `NameGenerator`'s and `AnyMap`'s rustdocs
Diffstat (limited to 'src/tools/rust-analyzer')
| -rw-r--r-- | src/tools/rust-analyzer/crates/ide-db/src/syntax_helpers/suggest_name.rs | 2 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/stdx/src/anymap.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/rust-analyzer/crates/ide-db/src/syntax_helpers/suggest_name.rs b/src/tools/rust-analyzer/crates/ide-db/src/syntax_helpers/suggest_name.rs index 51ce9b48293..5e68ccd3d32 100644 --- a/src/tools/rust-analyzer/crates/ide-db/src/syntax_helpers/suggest_name.rs +++ b/src/tools/rust-analyzer/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/src/tools/rust-analyzer/crates/stdx/src/anymap.rs b/src/tools/rust-analyzer/crates/stdx/src/anymap.rs index f55698ecb05..a3f6ab89510 100644 --- a/src/tools/rust-analyzer/crates/stdx/src/anymap.rs +++ b/src/tools/rust-analyzer/crates/stdx/src/anymap.rs @@ -82,12 +82,12 @@ pub type RawMap<A> = hash_map::HashMap<TypeId, Box<A>, BuildHasherDefault<TypeId /// ## Example /// /// (Here, the [`AnyMap`] convenience alias is used; -/// the first line could use `[anymap::Map][Map]::<[core::any::Any]>::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<A: ?Sized + Downcast = dyn Any> { /// The most common type of `Map`: just using `Any`; `[Map]<dyn [Any]>`. /// /// Why is this a separate type alias rather than a default value for `Map<A>`? -/// `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<dyn Any>; |
