Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/utils.rs')
| -rw-r--r-- | crates/ide-assists/src/utils.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ide-assists/src/utils.rs b/crates/ide-assists/src/utils.rs index f323ebcf7a..77f4b0e3e0 100644 --- a/crates/ide-assists/src/utils.rs +++ b/crates/ide-assists/src/utils.rs @@ -338,7 +338,12 @@ fn calc_depth(pat: &ast::Pat, depth: usize) -> usize { /// `find_struct_impl` looks for impl of a struct, but this also has additional feature /// where it takes a list of function names and check if they exist inside impl_, if -/// even one match is found, it returns None +/// even one match is found, it returns None. +/// +/// That means this function can have 3 potential return values: +/// - `None`: an impl exists, but one of the function names within the impl matches one of the provided names. +/// - `Some(None)`: no impl exists. +/// - `Some(Some(_))`: an impl exists, with no matching function names. pub(crate) fn find_struct_impl( ctx: &AssistContext<'_>, adt: &ast::Adt, |