guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Mathieu Othacehe
Date: Mon, 22 Feb 2021 03:09:12 -0500 (EST)

branch: master
commit aa9099e4df63760c478ac1e768d642da518aa8d9
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sun Feb 21 09:15:39 2021 +0100

    Move date->rfc822-str to utils.scm.
    
    * src/cuirass/rss.scm (date->rfc822-str): Move it to ...
    * src/cuirass/utils.scm: ... here.
---
 src/cuirass/rss.scm   | 4 +---
 src/cuirass/utils.scm | 8 +++++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/cuirass/rss.scm b/src/cuirass/rss.scm
index b5e8797..20fa7ba 100644
--- a/src/cuirass/rss.scm
+++ b/src/cuirass/rss.scm
@@ -18,6 +18,7 @@
 
 (define-module (cuirass rss)
   #:use-module (cuirass database)
+  #:use-module (cuirass utils)
   #:use-module (srfi srfi-19)
   #:use-module (srfi srfi-26)
   #:use-module (sxml simple)
@@ -126,9 +127,6 @@ list ATTRS and the child nodes in BODY."
     (lambda (port)
       (sxml->html sxml port))))
 
-(define (date->rfc822-str date)
-  (date->string date "~a, ~d ~b ~Y ~T ~z"))
-
 (define* (build->rss-item build)
   "Convert BUILD into an RSS <item> node."
   (let* ((id       (assq-ref build #:id))
diff --git a/src/cuirass/utils.scm b/src/cuirass/utils.scm
index 892419a..dfc5dd9 100644
--- a/src/cuirass/utils.scm
+++ b/src/cuirass/utils.scm
@@ -30,6 +30,7 @@
   #:use-module (rnrs bytevectors)
   #:use-module (system foreign)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-19)
   #:use-module (json)
   #:use-module (fibers)
   #:use-module (fibers channels)
@@ -52,7 +53,9 @@
             %non-blocking
             non-blocking
             essential-task
-            bytevector-range))
+            bytevector-range
+
+            date->rfc822-str))
 
 (define (alist? obj)
   "Return #t if OBJ is an alist."
@@ -317,3 +320,6 @@ die silently while the rest of the program keeps going."
                 (range   (pointer->bytevector pointer count)))
            (hashq-set! %weak-references range bv)
            range))))
+
+(define (date->rfc822-str date)
+  (date->string date "~a, ~d ~b ~Y ~T ~z"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]