From b51788f49dc1ceddae868719a1a128145cb66042 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Wed, 21 Aug 2024 11:51:35 +0100 Subject: [PATCH] Remove more shorthand --- src/gleam/otp/static_supervisor.gleam | 4 ++-- test/gleam/otp/static_supervisor_test.gleam | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gleam/otp/static_supervisor.gleam b/src/gleam/otp/static_supervisor.gleam index 81af54d..3191acf 100644 --- a/src/gleam/otp/static_supervisor.gleam +++ b/src/gleam/otp/static_supervisor.gleam @@ -239,7 +239,7 @@ pub fn supervisor_child( /// /// The default value for significance is `False`. pub fn significant(child: ChildBuilder, significant: Bool) -> ChildBuilder { - ChildBuilder(..child, significant:) + ChildBuilder(..child, significant: significant) } /// This defines the amount of milliseconds a child has to shut down before @@ -261,7 +261,7 @@ pub fn timeout(child: ChildBuilder, ms ms: Int) -> ChildBuilder { /// /// The default value for significance is `Permenent`. pub fn restart(child: ChildBuilder, restart: Restart) -> ChildBuilder { - ChildBuilder(..child, restart:) + ChildBuilder(..child, restart: restart) } fn convert_child(child: ChildBuilder) -> Dict(Atom, Dynamic) { diff --git a/test/gleam/otp/static_supervisor_test.gleam b/test/gleam/otp/static_supervisor_test.gleam index 1bbcabc..97df232 100644 --- a/test/gleam/otp/static_supervisor_test.gleam +++ b/test/gleam/otp/static_supervisor_test.gleam @@ -1,15 +1,10 @@ import gleam/erlang/process.{type Pid, type Subject} import gleam/otp/actor import gleam/otp/static_supervisor as sup -import gleeunit - -pub fn main() { - gleeunit.main() -} fn actor_child(name name, init init, loop loop) -> sup.ChildBuilder { sup.worker_child(name, fn() { - let spec = actor.Spec(init:, init_timeout: 10, loop:) + let spec = actor.Spec(init: init, init_timeout: 10, loop: loop) let assert Ok(subject) = actor.start_spec(spec) Ok(process.subject_owner(subject)) }) @@ -22,7 +17,7 @@ fn init_notifier_child( name: String, ) -> sup.ChildBuilder { actor_child( - name:, + name: name, init: fn() { process.send(subject, #(name, process.self())) actor.Ready(name, process.new_selector())