resyntax
resyntax copied to clipboard
New rule: `manual-display-to-file`
Rule summary
Code using call-with-output-file and display / displayln can use display-to-file / display-lines-to-file instead.
Test case
#lang resyntax/test
test: "original code should be refactorable to new code"
--------------------
#lang racket
(define (f path s)
(call-with-output-file path
(lambda (out)
(displayln s out))))
====================
#lang racket
(define (f path s)
(display-lines-to-file (list s) path))
--------------------