serde icon indicating copy to clipboard operation
serde copied to clipboard

[feat] better DX when function renamed

Open loynoir opened this issue 5 months ago • 0 comments

feat

better DX when function renamed

problem

When function renamed

  • serde attribute is not renamed

Would be nice to have attribute auto renamed for better DX.

Is it possible?

Are there any road blockers issue trackers?

current

current before renamed

#[derive(Deserialize)]
pub struct Reproduce {
    #[serde(default = "foo")]
    pub foo: String,
}

pub fn foo() -> String {
    "foo".into()
}

current after renamed, serde default attribute is not changed

#[derive(Deserialize)]
pub struct Reproduce {
    #[serde(default = "foo")]
    pub foo: String,
}

pub fn renamed() -> String {
    "foo".into()
}

feat

expect before renamed

#[derive(Deserialize)]
pub struct Reproduce {
    #[serde(default = foo)]
    pub foo: String,
}

pub fn foo() -> String {
    "foo".into()
}

expect after renamed, serde default attribute is changed

#[derive(Deserialize)]
pub struct Reproduce {
    #[serde(default = renamed)]
    pub foo: String,
}

pub fn renamed() -> String {
    "foo".into()
}

loynoir avatar Nov 14 '25 04:11 loynoir