Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rotate #4

Open
Erk- opened this issue Jun 26, 2022 · 0 comments
Open

Add support for rotate #4

Erk- opened this issue Jun 26, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Erk-
Copy link
Owner

Erk- commented Jun 26, 2022

When rotate_left is used the inverse should be rotate_right and the same the other way around.

For example

a.rotate_left(b);
// ↓ 
a.rotate_right(b);

This is likely not enough since rotate is not a mutating operation so a way would be to make our own function along the lines of:

fn rotate_left(i: &mut u32, n: u32) {
    *i = *i.rotate_left(n);
}

And then swap that between left and right in the reverse macro.

@Erk- Erk- added enhancement New feature or request good first issue Good for newcomers labels Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant