2 ms·
Yeah, that's fine. I'm making a static site generator and I want each post to have optional links to the next and previous posts, so something like: let pa
by throwaway894345 6y ago
Yeah, that's fine. I'm making a static site generator and I want each post to have optional links to the next and previous posts, so something like:
let pages = posts.windows::<3>().map(|[prev, this, next]| Page {
item: this,
prev: Some(to_url(prev)),
next: Some(to_url(next)),
});
// then attach first and last pages