Closed YaLTeR closed 3 years ago
Do you have a list of other traits?
error[E0034]: multiple applicable items in scope
--> src/video_preview.rs:138:44
|
138 | let error = media_file.error().unwrap();
| ^^^^^ multiple `error` found
|
= note: candidate #1 is defined in an impl of the trait `gtk4::prelude::GLAreaExt` for the type `O`
= note: candidate #2 is defined in an impl of the trait `gtk4::prelude::MediaStreamExt` for the type `O`
= note: candidate #3 is defined in an impl of the trait `gtk4::prelude::PrintOperationExt` for the type `O`
= note: candidate #4 is defined in an impl of the trait `gtk4::prelude::MediaStreamExtManual` for the type `O`
help: disambiguate the associated function for candidate #1
|
138 | let error = gtk4::prelude::GLAreaExt::error(&media_file).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #2
|
138 | let error = gtk4::prelude::MediaStreamExt::error(&media_file).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #3
|
138 | let error = gtk4::prelude::PrintOperationExt::error(&media_file).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #4
|
138 | let error = gtk4::prelude::MediaStreamExtManual::error(&media_file).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: candidate #2 is defined in an impl of the trait
gtk4::prelude::MediaStreamExt
for the typeO
= note: candidate #4 is defined in an impl of the traitgtk4::prelude::MediaStreamExtManual
for the typeO
These two are probably the problem. They both apply to the current type, so the compiler can't make a decision for you. If one disappears it should compile fine.
Ah yes there's a method to get and set the error that have the same name. We should prefix the setter with set_, that would fix the issue.
Thanks, that worked
I updated to latest gtk4-rs: https://gitlab.gnome.org/YaLTeR/video-trimmer/-/commit/83e0f4015484ad3c566db2d11fa9f126a12cb65c#596ffd44ab388aa7cc024f7219a9c39f7788215f
Generally everything became better, except this one change I had to do: https://gitlab.gnome.org/YaLTeR/video-trimmer/-/commit/83e0f4015484ad3c566db2d11fa9f126a12cb65c#596ffd44ab388aa7cc024f7219a9c39f7788215f_153_147
Because
error()
is also found in a few other associated traits. I wonder why it worked before withget_error()
then?