Fix handling of empty result sets in _changes

This commit is contained in:
Magnus Hoff 2017-10-23 16:13:18 +02:00
parent f097313e53
commit a270963824
2 changed files with 5 additions and 5 deletions

View file

@ -247,11 +247,6 @@ impl Resource for ChangesResource {
.and_then(move |(mut data, head)| {
use std::iter::Iterator;
if data.len() == 0 {
// TODO Handle degenerate case
unimplemented!("Cannot deal with empty result sets");
}
let extra_element = if data.len() > self.limit as usize {
data.pop()
} else {

View file

@ -9,11 +9,13 @@
><li><a rel="first" href="{{.end}}">Most recent changes</a></li
></ul></nav>{{/newer}}
<table>
{{#changes?}}
<tr>
<th>Article</th>
<th>Updated</th>
<th>Author</th>
</tr>
{{/changes}}
{{#changes}}
<tr>
<td><a href="{{#.slug.is_empty()?}}.{{/.slug.is_empty()}}{{.slug}}">{{.title}}</a></td>
@ -22,6 +24,9 @@
</tr>
{{/changes}}
</table>
{{^changes?}}
<p>No hits</p>
{{/changes}}
{{#older}}<nav><ul class="dense"
><li><a rel="next" href="{{.more}}">Older changes</a></li
><li><a rel="last" href="{{.end}}">First changes</a></li