diff options
author | Bruno Victal <mirai@makinata.eu> | 2023-10-07 16:59:07 +0100 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-10-07 12:41:05 -0400 |
commit | dd65564db05a747d1302164e962195caf887a854 (patch) | |
tree | f757267f861ee807a30f621a2a3cb13ed58c5dcc /gnu/services | |
parent | a7994ed58dc1ac3b57aa2df8508f05fd0748b3e0 (diff) |
services: fstrim-service-type: Serialize with SRFI-171 transducers.
* gnu/services/linux.scm (serialize-fstrim-configuration): Refactor to use
base-transducer.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/services')
-rw-r--r-- | gnu/services/linux.scm | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm index 1f01b39a21..9ee0d93030 100644 --- a/gnu/services/linux.scm +++ b/gnu/services/linux.scm @@ -41,6 +41,7 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-171) #:use-module (ice-9 format) #:use-module (ice-9 match) #:export (earlyoom-configuration @@ -252,13 +253,9 @@ more information)." (prefix fstrim-)) (define (serialize-fstrim-configuration config) - (concatenate - (filter list? - (map (lambda (field) - ((configuration-field-serializer field) - (configuration-field-name field) - ((configuration-field-getter field) config))) - fstrim-configuration-fields)))) + (list-transduce (compose (base-transducer config) tconcatenate) + rcons + fstrim-configuration-fields)) (define (fstrim-mcron-job config) (match-record config <fstrim-configuration> (package schedule) |