Example not working: no method named `unwrap`
Closed this issue · 2 comments
I added this under [dependencies]
in Cargo.toml
: cue_sheet = "0.2.0"
$ wget https://raw.githubusercontent.com/leoschwarz/cue_sheet/master/examples/to_mb.rs
$ cargo build
...
either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present
$ mv to_mb.rs main.rs
$ cargo build ✭master
Compiling music v0.1.0 (/home/michael/rust/music)
error[E0599]: no method named `unwrap` found for type `std::string::String` in the current scope
--> src/main.rs:48:29
|
48 | t.clone().title.unwrap(),
| ^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
error: Could not compile `music`.
To learn more, run the command again with --verbose.
Hi, thanks for reporting! Apparently this is a version incompatibility since I haven't pushed the latest commit to crates.io yet but the example depends on the latest changes from this repo. I'll look into why I have changed the title field of tracks to optional, and either revert that change or upload the unchanged version to crates.io. The titles are actually optional and this was introduced in 570b33c, I'm going to update the dependencies and upload a v0.3.0 to crates.io.
Should be working now, please reopen the issue if it persists and feel free to open new ones if you encounter other issues. (Also just in case you might be interested in something more solid there is also the crate cue
which uses the libcue library which is probably more battle tested but uses native/"unsafe" code.)