Distinguish NoLibrary/NoDatabase from EmptyLibrary/EmptyDatabase #95

Closed
opened 2024-01-12 09:35:17 +01:00 by wojtek · 2 comments
Owner

There is a subtle difference between the two. EmtpyLibrary is to be used with code that expects a library, but the user does not want to provide one (e.g. using the --no-library option). NoLibrary should be used when the code does not expect a library, but the compiler requires a suitable type to be specified.

This will remove the Options fromMusicHoard.

There is a subtle difference between the two. `EmtpyLibrary` is to be used with code that expects a library, but the user does not want to provide one (e.g. using the `--no-library` option). `NoLibrary` should be used when the code does not expect a library, but the compiler requires a suitable type to be specified. This will remove the `Option`s from`MusicHoard`.
wojtek added this to the v0.2.0 milestone 2024-01-12 09:35:17 +01:00
wojtek added the
chore
label 2024-01-12 09:35:17 +01:00
Author
Owner

To do this nicely and idiomatically, this may require being specific on trait bounds in the impl of MusicHoard. This way EmptyLibrary implements ILibrary, but NoLibrary does not.

To do this nicely and idiomatically, this may require being specific on trait bounds in the `impl` of `MusicHoard`. This way `EmptyLibrary` implements `ILibrary`, but `NoLibrary` does not.
Author
Owner

And provide convenience constructors to make the No/Empty variants easy to create. Probably with a builder pattern.

And provide convenience constructors to make the `No`/`Empty` variants easy to create. Probably with a builder pattern.
wojtek added reference 95---distinguish-nolibrary/nodatabase-from-emptylibrary/emptydatabase 2024-01-12 20:26:12 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: wojtek/musichoard#95
No description provided.