jorgecarleitao / arrow2

Transmute-free Rust library to work with the Arrow format
Apache License 2.0
1.07k stars 220 forks source link

Rename non-From implementations of from #1530

Open orlp opened 11 months ago

orlp commented 11 months ago

There are some implementations of a from method that are not part of the From trait. Those should probably be renamed to something else, because they normal block usage of From.

E.g. I can't write Utf8Array::from(a) where a has type MutableUtf8Array, despite that conversion existing, because the Rust compiler interprets that as me trying to call the concrete from method for a different type. So I am either forced to write <Utf8Array as From>::from(a) or use a temporary variable with .into().

ritchie46 commented 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: