Skip to content

Join Vector<Html<T>> with separator #85

Description

@OskarPersson

How can I join a vector of html strings with a custom separator? With for exampe Vec<String> I would use join but this isn't available for Html. This is what I've tried:

   |
16 | (users.into_iter().map(|u| Html(format!("<a href=\"example.com/{}\">{}</a>", u.name, u.name))).collect::<Vec<Html<String>>>().join(",")).to_html(&mut _ructe_out_)?;
   |                                                                                                                               ^^^^ method not found in `std::vec::Vec<templates::Html<std::string::String>>`
   |
   = note: the method `join` exists but the following trait bounds were not satisfied:
           `<[templates::Html<std::string::String>] as std::slice::Join<_>>::Output = _`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions