Open d-unsed opened 7 years ago
Just curious about the Object::try_convert_into<T: VerifiedObject>(self) -> Result<T>
scenario. Would taking ownership be bad in this case when the type isn't what you try for the first time? If the result is an Err(Error)
because it's a different type the ownership would already be consumed… right?
@danielpclark The usual workaround is returning the original value as part of the error.
The following methods should take
self
by value, because technically they return the same Ruby objects converted to another Rust type.[ ]
Object::to
changes to
[ ]
Object::try_convert_to
changes to
[ ]
Object::to_any_object()
changes to
For example:
some_object
should be consumed byconvert_into
, becausefixnum
andsome_object
correspond to the same object in Ruby.