rust-analyzer/crates/test_utils/src
bors[bot] 6877240fdf
Merge #10563
10563: feat: Make "Generate getter" assist use semantic info r=agluszak a=agluszak

This PR makes "Generate getter" assist use semantic info instead of dealing with types encoded as strings.
Getters for types which are:
- `Copy` no longer return references
- `AsRef<str>` (i.e. `String`) return `&str` (instead of `&String`)
- `AsRef<[T]>` (i.e. `Vec<T>`) return `&[T]` (instead of `&Vec<T>`)
- `AsRef<T>` (i.e. `Box<T>`) return `&T` (instead of `&Box<T>`)
- `Option<T>` return `Option<&T>` (instead of `&Option<T>`)
- `Result<T, E>` return `Result<&T, &E>` (instead of `&Result<T, E>`)

String, Vec, Box and Option were previously handled as special cases.

Closes #10295


Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
2021-10-20 21:02:46 +00:00
..
assert_linear.rs Add semicolons for consistency 2021-10-03 23:39:43 +11:00
bench_fixture.rs Let's try testing for "is not quadratic" condition 2021-04-10 12:43:07 +03:00
fixture.rs internal: move tests 2021-10-10 12:39:58 +03:00
lib.rs Add semicolons for consistency 2021-10-03 23:39:43 +11:00
minicore.rs Merge #10563 2021-10-20 21:02:46 +00:00