From a2709638242e49c04aebe5e852ccdd5500ed57a8 Mon Sep 17 00:00:00 2001 From: Magnus Hoff Date: Mon, 23 Oct 2017 16:13:18 +0200 Subject: [PATCH] Fix handling of empty result sets in _changes --- src/resources/changes_resource.rs | 5 ----- templates/changes.html | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/resources/changes_resource.rs b/src/resources/changes_resource.rs index b96da11..7397ce2 100644 --- a/src/resources/changes_resource.rs +++ b/src/resources/changes_resource.rs @@ -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 { diff --git a/templates/changes.html b/templates/changes.html index 4adabc1..3589dcc 100644 --- a/templates/changes.html +++ b/templates/changes.html @@ -9,11 +9,13 @@ >
  • Most recent changes
  • {{/newer}} + {{#changes?}} + {{/changes}} {{#changes}} @@ -22,6 +24,9 @@ {{/changes}}
    Article Updated Author
    {{.title}}
    +{{^changes?}} +

    No hits

    +{{/changes}} {{#older}}