Skip to content

Instantly share code, notes, and snippets.

@maiha
Last active March 9, 2024 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiha/ff5be260ca7555d0a01e54745f62acc7 to your computer and use it in GitHub Desktop.
Save maiha/ff5be260ca7555d0a01e54745f62acc7 to your computer and use it in GitHub Desktop.
practical migrating guide to crystal-0.20.4

Restrict argument types having a default value (#3834)

-    def info(section : String = nil)
+    def info(section : String? = nil)

to_json (aka. missing json_object)

--- a/src/jq/mapping.cr
+++ b/src/jq/mapping.cr
@@ -75,12 +75,12 @@ class Jq
       {% end %}
     end

-    def to_json(io : IO)
-      io.json_object do |json|
+    def to_json(json : JSON::Builder)
+      json.object do
         {% for key, tuple in properties %}
           _{{key.id}} = @{{key.id}}
           json.field({{key.id.stringify}}) do
-            _{{key.id}}.to_json(io)
+            _{{key.id}}.to_json(json)
           end
         {% end %}
       end

OptionParser

  • old: OptionParser#parse(Array(String)) : Array(String)
  • new: OptionParser#parse(Array(String)) : Nil

status

  • app.cr
  • comment-spec.cr
  • core-ext.cr
  • crc16.cr
  • crt.cr
  • dstat-redis.cr
  • grafana-redis.cr
  • hq.cr
  • jq.cr
  • kafka.cr
  • memoized.cr
  • opts.cr
  • pcap.cr
  • rcm.cr
  • redis-cluster.cr
  • redis-tsv.cr
  • rocksdb.cr
  • shard.cr
  • toml-config.cr
  • traildb.cr
  • try.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment