• 4 Posts
  • 383 Comments
Joined 1 year ago
cake
Cake day: November 24th, 2023

help-circle


  • I wouldn’t mind having a explanation of what you want to do instead of the code. It’s not quite clear what you mean.

    Anyways, what you want is to transform an iterator (your Select) into an iterator of Option<String>?

    For that, there’s multiple ways but here’s the simplest:

    link_nodes.map(|node| node.value().attr("href").to_string())

    Essentially, for each elements, we execute a closure (arrow function in JavaScript) that transform the node into your href string.

    P.S. can’t guarantee it works, I don’t know what this “Select” type is, and I’m programming on mobile