-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Since Snippet<'a, T>'s markers field is private to library users, please consider exposing it via a markers(&self) -> &[T] method.
My use case is that I'm building Snippets downstream deep within my program, but after all that is done I need to go through all the constructed Snippets again and merge them in some cases (which in my case just consists of accessing A's annotations and re-registering them to B). However, this is not possible if I cannot access what annotations have been registered to A.
This is something incredibly simple for you to support, but without such a method I'll have to restructure all my code to build custom (accessible) MySnippet structs and only convert them to real Snippets at the very end, which is of course just adding unnecessary complexity and performance overhead.
I understand unnecessarily exposing internal logic can lead to maintenance pains down the line, but I cannot see a world where you'd ever change the internal representation so much that this method is no longer sustainable without you also having to change more parts of the public API, so I don't foresee this would ever be an issue.
P.S.: Thank you so much for creating and maintaining annotate-snippets! I just started using it and it seems to work great.