diff --git a/lib/asciinema_web/live_stream_producer_socket.ex b/lib/asciinema_web/live_stream_producer_socket.ex index da4ac3886..7ddc4aa8d 100644 --- a/lib/asciinema_web/live_stream_producer_socket.ex +++ b/lib/asciinema_web/live_stream_producer_socket.ex @@ -290,9 +290,12 @@ defmodule AsciinemaWeb.LiveStreamProducerSocket do @protos ~w(v1.alis v2.asciicast raw) defp select_protocol(protos) do - # choose common protos between the client and the server - # using client preferred order + # Choose common protos between the client and the server using client preferred order. common = protos -- protos -- @protos + # Note the --/2 operator is right associative, + # and this would be more clearly expressed as + # common = protos -- (protos -- @protos) + # but mix.format removes the parenthesis ¯\_(ツ)_/¯ List.first(common) end