Skip to content

roots() method on impl Polynomial consumes self unnecessarily #7

@extremeandy

Description

@extremeandy

It seems unnecessary to me that roots() consumes self. Could we not make roots() accept &self instead of self, since find_roots only requires a reference?

impl Polynomial<f64> {
    pub fn roots(self) -> Roots<f64> {
        find_roots(&self)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions