From 9fc335c6aebfcb83b8cf6be354f169a237920ad0 Mon Sep 17 00:00:00 2001 From: John Conway Date: Thu, 9 May 2019 22:13:26 +0100 Subject: [RSS] Added Tests, fixes, rewrites --- src/feednim/atom.nim | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/feednim/atom.nim') diff --git a/src/feednim/atom.nim b/src/feednim/atom.nim index 431bd5e..a432844 100644 --- a/src/feednim/atom.nim +++ b/src/feednim/atom.nim @@ -12,7 +12,7 @@ import streams import sugar type - AtomCommon = ref object of RootObj + AtomCommon = ref object of RootObj # These properties aren't gathered yet xmlbase*: string xmllang*: string @@ -92,7 +92,7 @@ type # Promotes text node to the top of an AtomText object if caller expects a string -converter toString*(obj: AtomText): string = +converter atomToString*(obj: AtomText): string = return obj.text @@ -250,16 +250,13 @@ proc parseAtom* ( data: string ): Atom = else: atom.author = AtomAuthor() - # If there are no entries: - if node.child("entry") == nil: + + if node.child("entry") == nil: # If there are no entries: atom.entries = @[] return atom - # Otherwise, add the entries. - if node.child("entry") != nil: + if node.child("entry") != nil: # Otherwise, add the entries. atom.entries = map( node.findAll("entry"), parseEntry ) # Return the Atom data. - return atom - - + return atom \ No newline at end of file -- cgit v1.2.3