Skip to content
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

read_from_path should not panic without extension #7

Closed
woelper opened this issue Oct 21, 2021 · 1 comment · Fixed by #21
Closed

read_from_path should not panic without extension #7

woelper opened this issue Oct 21, 2021 · 1 comment · Fixed by #21

Comments

@woelper
Copy link

woelper commented Oct 21, 2021

currently, extensions are handled like this:

path.as_ref()
    .extension()
    .unwrap()
    .to_string_lossy()
    .to_string()
    .to_lowercase()
    .as_str(),

Which could panic due to the unwrap().
as try_from_ext already handles extensions, maybe we could unwrap_or into an empty OsStr or use ??

@pinkforest
Copy link
Collaborator

Hm. We just re-merged audiotags2 into audiotags and there were a lot of changes.

I think these unwraps may be still there - I have to check

Please feel free to send a PR to fix and put some erroring if you find panic'y unwraps

Serial-ATA added a commit to Serial-ATA/audiotags that referenced this issue Aug 1, 2022
Serial-ATA added a commit to Serial-ATA/audiotags that referenced this issue Aug 1, 2022
pinkforest pushed a commit that referenced this issue Aug 2, 2022
* Remove `unwrap` in `Tag::read_from_path`

closes: #7

* Fix `Id3v2Tag::{*year}` methods

closes: #9

* Fix unused `Result` in `Tag` doc example

* Reorder `FlagTag` and `Mp4Tag` impls to match `AudioTagEdit`

* Change `Tag::read_from_path` return type to `Result<Box<dyn AudioTag + Send + Sync>>`

closes: #8

* Fix doc test

* Fix typos

* Bump versions

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants