Open orlp opened 11 months ago
Right, I understand the sentiment.
Given that we name the iterator over Option<&str>
iter
and the iterator over &str
iter_values
, I think it would be better to rename from_slice
to from_slice_values
and this from that collides with From::from
, from_slice
.
So summarizing:
from(&[Option<T>]) -> from_slice(&[Option<T>])
from_slice(&[T]) -> from_slice_values(&[T])
There are some implementations of a
from
method that are not part of theFrom
trait. Those should probably be renamed to something else, because they normal block usage ofFrom
.E.g. I can't write
Utf8Array::from(a)
wherea
has typeMutableUtf8Array
, despite that conversion existing, because the Rust compiler interprets that as me trying to call the concretefrom
method for a different type. So I am either forced to write<Utf8Array as From>::from(a)
or use a temporary variable with.into()
.