From 859f32873b5313dfe9353e293fa7cd9c569be64f Mon Sep 17 00:00:00 2001 From: Istvan Date: Fri, 9 Jan 2026 09:09:38 +0100 Subject: [PATCH] fix: use map update to avoid struct type warning in add_namespace/3 Elixir 1.19+ type checker warns when using struct update syntax with a dynamic type. Since the function head already pattern matches on %SweetXpath{}, we can safely use map update syntax instead. Co-Authored-By: Claude Opus 4.5 --- lib/sweet_xml.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sweet_xml.ex b/lib/sweet_xml.ex index 8af1015..afedbaa 100644 --- a/lib/sweet_xml.ex +++ b/lib/sweet_xml.ex @@ -255,7 +255,7 @@ defmodule SweetXml do end def add_namespace(%SweetXpath{} = xpath, prefix, uri) do - %SweetXpath{ + %{ xpath | namespaces: [ {to_charlist(prefix), to_charlist(uri)}