gyscos / gyscos/cursive

[FEATURE] Detect name collisions

Open
#693 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.