{"record":{"id":"cf0a9c739be54557","repo":"leptos-rs/leptos","slug":"keyword-argument-repeated-protocol","errorCode":null,"errorMessage":"keyword argument repeated: `protocol`","messagePattern":"keyword argument repeated: `protocol`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server_fn_macro/src/lib.rs","lineNumber":1181,"sourceCode":"                    } 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`\",\n                            ));\n                        }\n                        protocol = Some(stream.parse()?);\n                    } else {\n                        return Err(lookahead.error());\n                    }\n                } else {\n                    let value = key_or_value;","sourceCodeStart":1163,"sourceCodeEnd":1199,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/server_fn_macro/src/lib.rs#L1163-L1199","documentation":"Same duplicate-key rule as other options: the `impl_deref` keyword may appear at most once in a #[server] attribute. A second occurrence makes the syn parser error at the repeated key's span, since the macro stores it in a single Option.","triggerScenarios":"#[server(impl_deref = true, impl_deref = true)]; pasting an existing attribute's options twice; code-generation tools emitting `impl_deref` redundantly.","commonSituations":"Refactoring where `impl_deref` was appended by an assistant/tool without noticing it already existed; IDE snippets that include the option while the user adds it manually too.","solutions":["Delete the second `impl_deref` entry so the attribute contains exactly one.","Verify the single boolean value matches your intent.","Regenerate the attribute from the documented option list to avoid stray duplicates."],"exampleFix":"// before\n#[server(impl_deref = true, impl_deref = true)]\n// after\n#[server(impl_deref = true)]","handlingStrategy":"validation","validationCode":"let attr = \"#[server(impl_deref = true, impl_deref = true)]\";\nassert!(attr.matches(\"impl_deref\").count() <= 1, \"duplicate `impl_deref`\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When appending options, read the whole attribute first","Let the compiler catch duplicates early with frequent cargo check","Standardize on one canonical attribute template per project"],"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"}