You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/11 18:17:35 UTC

[GitHub] [arrow-rs] jorgecarleitao commented on issue #598: Allow the creation of String arrays from an interator of &Option<&str>

jorgecarleitao commented on issue #598:
URL: https://github.com/apache/arrow-rs/issues/598#issuecomment-897046153


   I am probably missing something. The below does not compile:
   
   ```rust
   let array: StringArray = [Some("foo"), None, Some("bar")]
           .iter()
           .collect();
   ```
   
   isn't it enough to use `.map(|x| x.as_ref())`:
   
   ```rust
   let array: StringArray = [Some("foo"), None, Some("bar")]
           .iter()
           .map(|x| x.as_ref())
           .collect();
   ```
   
   it is 20 more characters, but it does not seem _that_ bad?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org