gtk-rs-core icon indicating copy to clipboard operation
gtk-rs-core copied to clipboard

Wrong self convention for `ToValueOptional`, `ToGlibContainerFromSlice`

Open sdroege opened this issue 3 years ago • 1 comments

error: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference
   --> gstreamer/src/miniobject.rs:462:34
    |
462 |               fn to_value_optional(s: Option<&Self>) -> $crate::glib::Value {
    |                                    ^
error: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference
   --> gstreamer/src/miniobject.rs:167:40
    |
167 |               fn to_glib_none_from_slice(t: &'a [$name]) -> (*mut *mut $ffi_name, Self::Storage) {
    |                                          ^

CC @GuillaumeGomez @bilelmoussaoui

sdroege avatar Jun 20 '21 07:06 sdroege

It seems to me that it is the lint that is wrong

  1. to_value_optional(s: Option<&Self>) is taking &Self...
  2. to_glib_none_from_slice is taking &[]

pbor avatar Jan 07 '22 16:01 pbor