[FEATURE] Detect name collisions
- Dominant language
- Rust
- Stars
- 4.8k
- Forks
- 270
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 2
Description
**Is your feature request related to a problem? Please describe.**
At this point in time, cursive does not detect when multiple views are given the same name. Puzzling debugging sessions may ensue as call_on_name calls reach the wrong target.
**Describe the solution you'd like**
Cursive should detect this API usage error and handle it. Panicking would most likely be appropriate here.
**Describe alternatives you've considered**
- APIs that name views, such as Nameable::with_name, could return a type that can handle the possibility of error, such as an Option or Result.
- These APIs could automatically generate derived names e.g. "RequestedName#123" and return that when a requested name is already taken.
- Usage of user-defined names could be replaced by collision-free alternatives, such as 64-bit integers generated by a global atomic counter.
However, I think this is too much of an edge case to justify expending so much implementation care and/or API surface on it.
Contributor guide
Assessment
This issue has not been assessed yet.