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

mod disjoint_mut: Remove unused trait bounds and derives #1315

Merged

Conversation

nnethercote
Copy link
Contributor

Just some unnecessary code I noticed while looking at disjoint_mut.rs.

Copy link
Collaborator

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it important to remove the unused TranslateRange and SliceBounds impls? I added them so that we can index DisjointMuts in all of the same ways normal slices can be done. The unused ones are DCEd, right?

Copy link
Collaborator

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trait bounds we can get rid of, though.

@nnethercote
Copy link
Contributor Author

The unused ones are DCEd, right?

Yes. It's just a code complexity/comprehensibility thing, not a performance thing. I was trying to understand some code, then I looked for how it was used, then I found it wasn't used. I'm a firm believer in generally not keeping around dead code, but this isn't my codebase, so I'm happy to defer.

@nnethercote nnethercote force-pushed the rm-unused-impls-and-trait-bounds branch from f86d183 to cc1503d Compare July 14, 2024 22:15
@nnethercote nnethercote changed the title Remove unused impls and trait bounds Remove unused trait bounds and derives Jul 14, 2024
@nnethercote
Copy link
Contributor Author

I have removed the first commit.

@kkysen
Copy link
Collaborator

kkysen commented Jul 15, 2024

The unused ones are DCEd, right?

Yes. It's just a code complexity/comprehensibility thing, not a performance thing. I was trying to understand some code, then I looked for how it was used, then I found it wasn't used. I'm a firm believer in generally not keeping around dead code, but this isn't my codebase, so I'm happy to defer.

Ah. I think we'd like to keep these to keep the API similar to normal slices, even if all of them aren't actively used, as we may use them in the future.

@kkysen kkysen changed the title Remove unused trait bounds and derives mod disjoint_mut: Remove unused trait bounds and derives Jul 15, 2024
@kkysen kkysen merged commit 72b9765 into memorysafety:main Jul 15, 2024
27 checks passed
@nnethercote nnethercote deleted the rm-unused-impls-and-trait-bounds branch July 15, 2024 23:56
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.

2 participants