fix(env_file): rename _s -> s on commit/rollback_apply to match parent

Crystal's compiler warns when an overriding method's parameter name
differs from the parent's, since named-argument callers would pass
the wrong slot. Underscore-prefix was meant as 'unused' but it changed
the parameter name, which Crystal correctly flagged.

Match the parent signature (s : Domain::NewSecret) and use the explicit
'_ = s' idiom inside the body to mark it intentionally unused. Now
'shards build cre' compiles with zero warnings.
This commit is contained in:
CarterPerez-dev 2026-04-29 01:43:56 -04:00
parent 1b8cfc9589
commit 225716d140
1 changed files with 4 additions and 2 deletions

View File

@ -62,14 +62,16 @@ module CRE::Rotators
content.includes?(expected_line) && content.bytesize > 0
end
def commit(c : Domain::Credential, _s : Domain::NewSecret) : Nil
def commit(c : Domain::Credential, s : Domain::NewSecret) : Nil
_ = s
path = c.tag("path").not_nil!
pending_path = "#{path}.pending"
raise RotatorError.new("pending file missing at commit time: #{pending_path}") unless File.exists?(pending_path)
File.rename(pending_path, path)
end
def rollback_apply(c : Domain::Credential, _s : Domain::NewSecret) : Nil
def rollback_apply(c : Domain::Credential, s : Domain::NewSecret) : Nil
_ = s
path = c.tag("path").not_nil!
pending_path = "#{path}.pending"
File.delete(pending_path) if File.exists?(pending_path)