{"record":{"id":"e7af8176aa3985dd","repo":"leptos-rs/leptos","slug":"keyword-argument-repeated-impl-deref","errorCode":null,"errorMessage":"keyword argument repeated: `impl_deref`","messagePattern":"keyword argument repeated: `impl_deref`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server_fn_macro/src/lib.rs","lineNumber":1173,"sourceCode":"                    } else if key == \"client\" {\n                        if client.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `client`\",\n                            ));\n                        }\n                        client = Some(stream.parse()?);\n                    } else if key == \"custom\" {\n                        if custom_wrapper.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `custom`\",\n                            ));\n                        }\n                        custom_wrapper = Some(stream.parse()?);\n                    } else if key == \"impl_from\" {\n                        if impl_from.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `impl_from`\",\n                            ));\n                        }\n                        impl_from = Some(stream.parse()?);\n                    } else if key == \"impl_deref\" {\n                        if impl_deref.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `impl_deref`\",\n                            ));\n                        }\n                        impl_deref = Some(stream.parse()?);\n                    } else if key == \"protocol\" {\n                        if protocol.is_some() {\n                            return Err(syn::Error::new(\n                                key.span(),\n                                \"keyword argument repeated: `protocol`\",","sourceCodeStart":1155,"sourceCodeEnd":1191,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/server_fn_macro/src/lib.rs#L1155-L1191","documentation":"The #[server] macro parses each keyword argument only once. When the same keyword (here `impl_from`) appears a second time in the attribute list, the parser raises this syn error at the duplicated key's span, because re-assigning a single Option field would silently override the first value.","triggerScenarios":"Writing #[server(impl_from = true, impl_from = false)] on an async fn; copy-pasting attribute options and leaving a duplicate key; merging two #[server(...)] attribute lines into one and keeping both `impl_from` entries.","commonSituations":"Developers scaffolding many server functions from a template, or combining macro options during a refactor (e.g. adding `impl_from` while an older copy of the option was already present).","solutions":["Remove the duplicate `impl_from` key, keeping only one occurrence.","If both values differ, decide which behavior you want and keep that one.","Split genuinely different configuration into distinct options (e.g. `impl_from` vs `custom`) rather than repeating a key."],"exampleFix":"// before\n#[server(impl_from = true, impl_from = false)]\n// after\n#[server(impl_from = true)]","handlingStrategy":"validation","validationCode":"// Check the attribute before compiling:\n// grep -c 'impl_from' on the #[server(...)] line must be <= 1\nlet attr = \"#[server(impl_from = true, impl_from = false)]\";\nlet count = attr.matches(\"impl_from\").count();\nassert!(count <= 1, \"duplicate `impl_from` in #[server]\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep one option per line when formatting long #[server] attributes","Search for the keyword before adding a new option","Avoid hand-merging attributes from multiple templates"],"tags":["rust","proc-macro","parse-error","duplicate-argument"],"backgroundTag":"duplicate-keyword-argument","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}