-
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 Guid type since the RSS Guid is more detailed than the Atom one.
- Loading branch information
1 parent
e941306
commit 5c1498e
Showing
3 changed files
with
85 additions
and
4 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
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 Guid { | ||
pub is_permalink: bool, | ||
pub id: String, | ||
} | ||
|
||
impl Guid { | ||
pub fn from_id(id: String) -> Guid { | ||
Guid { | ||
is_permalink: true, | ||
id: id, | ||
} | ||
} | ||
} | ||
|
||
impl From<rss::Guid> for Guid { | ||
fn from(id: rss::Guid) -> Guid { | ||
Guid { | ||
is_permalink: id.is_perma_link, | ||
id: id.value, | ||
} | ||
} | ||
} | ||
|
||
impl From<Guid> for rss::Guid { | ||
fn from(id: Guid) -> rss::Guid { | ||
rss::Guid { | ||
is_perma_link: id.is_permalink, | ||
value: id.id, | ||
} | ||
} | ||
} |
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