-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add conversions between our Entry and RSS's Entry
Add the Image and TextInput types to support the change.
- Loading branch information
1 parent
3ffcfea
commit bbf50f9
Showing
6 changed files
with
178 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
target | ||
Cargo.lock | ||
.DS_Store | ||
*.bk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use rss; | ||
|
||
pub struct Image { | ||
pub url: String, | ||
pub title: String, | ||
pub link: String, | ||
pub width: Option<u32>, | ||
pub height: Option<u32>, | ||
} | ||
|
||
impl From<rss::Image> for Image { | ||
fn from(image: rss::Image) -> Image { | ||
Image { | ||
url: image.url, | ||
title: image.title, | ||
link: image.link, | ||
width: image.width, | ||
height: image.height, | ||
} | ||
} | ||
} | ||
|
||
impl From<Image> for rss::Image { | ||
fn from(image: Image) -> rss::Image { | ||
rss::Image { | ||
url: image.url, | ||
title: image.title, | ||
link: image.link, | ||
width: image.width, | ||
height: image.height, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use rss; | ||
|
||
pub struct TextInput { | ||
pub title: String, | ||
pub description: String, | ||
pub name: String, | ||
pub link: String, | ||
} | ||
|
||
impl From<rss::TextInput> for TextInput { | ||
fn from(input: rss::TextInput) -> TextInput { | ||
TextInput { | ||
title: input.title, | ||
description: input.description, | ||
name: input.name, | ||
link: input.link, | ||
} | ||
} | ||
} | ||
|
||
impl From<TextInput> for rss::TextInput { | ||
fn from(input: TextInput) -> rss::TextInput { | ||
rss::TextInput { | ||
title: input.title, | ||
description: input.description, | ||
name: input.name, | ||
link: input.link, | ||
} | ||
} | ||
} |