Skip to content

Commit f6cd70b

Browse files
jyn514Joshua Nelson
authored andcommitted
Fix 404 on /releases/feed
1 parent 666036c commit f6cd70b

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/web/page.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ impl<T: Serialize> Serialize for Page<T> {
120120
// adding the someness of the global alert to the total. `true`
121121
// is 1 and `false` is 0, so it increments if the value is some (and therefore
122122
// needs to be serialized)
123-
let mut state =
124-
serializer.serialize_struct("Page", 9 + crate::GLOBAL_ALERT.is_some() as usize)?;
123+
let mut state = serializer.serialize_struct(
124+
"Page",
125+
8 + crate::GLOBAL_ALERT.is_some() as usize + self.title.is_some() as usize,
126+
)?;
125127

126128
if let Some(ref title) = self.title {
127129
state.serialize_field("title", title)?;

src/web/releases.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ pub fn build_queue_handler(req: &mut Request) -> IronResult<Response> {
670670
#[cfg(test)]
671671
mod tests {
672672
use super::*;
673-
use crate::test::wrapper;
673+
use crate::test::{assert_success, wrapper};
674674
use serde_json::json;
675675

676676
#[test]
@@ -1060,4 +1060,12 @@ mod tests {
10601060

10611061
assert_eq!(correct_json, serde_json::to_value(&release).unwrap());
10621062
}
1063+
1064+
#[test]
1065+
fn release_feed() {
1066+
wrapper(|env| {
1067+
let web = env.frontend();
1068+
assert_success("/releases/feed", web)
1069+
})
1070+
}
10631071
}

templates/releases_feed.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link href="https://pubsubhubbub.appspot.com" rel="hub" />
88
<link href="https://pubsubhubbub.superfeedr.com" rel="hub" />
99
<id>urn:docs-rs:{{cratesfyi_version_safe}}</id>
10-
<updated>{{content[0].release_time_rfc3339}}</updated>
10+
<updated>{{content.[0].release_time_rfc3339}}</updated>
1111
{{#each content}}
1212
<entry>
1313
<title>{{name}}-{{version}}</title>

0 commit comments

Comments
 (0)