-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc: Introduce WriteOptions #363
Conversation
d8080e4
to
a09568c
Compare
src/write_options.rs
Outdated
@@ -0,0 +1,131 @@ | |||
/// Options to control how Lofty writes to a file | |||
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this public type copyable could require breaking API changes in the future if it no longer implements Copy
. If not needed internally then better remove this derive. Could be added later when it is actually needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the Ord
traits don't make any sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch with Ord
. I just copied ParseOptions
and renamed it to WriteOptions
. Guess I copied it from some other struct. I'll have to remove it from both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the future if it no longer implements Copy
I really only intend for WriteOptions
to be ints and bools just like ParseOptions
. Since it's used in generated code in lofty_attr
, it'll just be easier to keep it Copy
for now.
I'm not too worried about breaking changes at the moment, especially since I have to work on #345 sometime in the near future.
This allows the caller to tweak how Lofty writes their tags in various ways. As this is just a dumping ground for all sorts of format-specific settings, this is best used as an application global config that gets set once. In its current state, it will only respect `uppercase_id3v2_chunk` and `preferred_padding` (for some formats). `respect_read_only` and `remove_others` are defined for later use. closes #228
e337ddc
to
1aac4d4
Compare
This allows the caller to tweak how Lofty writes their tags in various ways.
As this is just a dumping ground for all sorts of format-specific settings, this is best used as an application global config that gets set once.
In its current state, it will only respect
uppercase_id3v2_chunk
andpreferred_padding
(for some formats).respect_read_only
andremove_others
are defined for later use.closes #228