Skip to content

Conversation

@nazar-pc
Copy link
Contributor

@nazar-pc nazar-pc commented Mar 1, 2023

Benchmarking CI is still running in my fork, but the other one finished successfully.

This PR tries to make code more idiomatic in Rust in a few ways:

  • fn default() in some trait replaced with dependency on standard Default trait with corresponding re-duplication
  • Many data structures got derives (sometimes instead of manual implementation) for traits Debug, Clone, Copy, Eq
  • As the result of those changes clippy was able to find numerous places to complain about, those were changed accordingly

The only non-equivalent change is that this was effectively replaced with Self::new(0):

impl Poly<FsFr> for LPoly {
    fn default() -> Self {
        Self::new(1).unwrap()
    }

There was already Default was already derived for LPoly automatically (with empty coefficients, naturally). In this self-conflicting situation I decided to prefer derived implementation since that is how other implementations are done too.

The rest of changes are mechanical even though API has changed slightly.

There are absolutely still things to improve, but I think this is a decent progress deserving its own PR.

@sauliusgrigaitis
Copy link
Member

Thanks @nazar-pc !

@belijzajac could you double-check and merge?

@belijzajac belijzajac merged commit 667d221 into grandinetech:update_upstream Mar 2, 2023
@nazar-pc nazar-pc deleted the more-idiomatic-rust branch March 2, 2023 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants