Skip to content

forbid as_u* method calls in linting#846

Merged
unconst merged 3 commits intoopentensor:devnet-readyfrom
eagr:lint-forbid-as-primitive
Oct 11, 2024
Merged

forbid as_u* method calls in linting#846
unconst merged 3 commits intoopentensor:devnet-readyfrom
eagr:lint-forbid-as-primitive

Conversation

@eagr
Copy link
Contributor

@eagr eagr commented Oct 8, 2024

Closes #841

Description

Add custom lint to forbid certain as_*() conversions to avoid accidental panics.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe): linting

@eagr eagr requested a review from unconst as a code owner October 8, 2024 18:24
@sam0x17
Copy link
Contributor

sam0x17 commented Oct 8, 2024

ok this looks great, if you could please instead make a PR into devnet-ready that would be great.

unfortunately github doesn't allow specifying a default branch for PRs that is different from default branch for clones

edit: I went ahead and changed base but there are now merge conflicts you will need to fix so might be preferable to just reset and stage your changes on top of current devnet-ready and commit that and force push

@sam0x17 sam0x17 changed the base branch from main to devnet-ready October 8, 2024 19:45
@eagr eagr force-pushed the lint-forbid-as-primitive branch from fd04f99 to 59ba20b Compare October 9, 2024 01:58
@eagr
Copy link
Contributor Author

eagr commented Oct 9, 2024

lmk if you need a hand on other issues :)

@sam0x17
Copy link
Contributor

sam0x17 commented Oct 9, 2024

just one clippy failure and then should be good to review+merge @eagr =)

@sam0x17
Copy link
Contributor

sam0x17 commented Oct 9, 2024

and now cargo fmt ;)

@eagr
Copy link
Contributor Author

eagr commented Oct 10, 2024

have been away from rust for a while. I have the commands set up again, it will be smoother next time :))

@unconst unconst merged commit 6406938 into opentensor:devnet-ready Oct 11, 2024
@sam0x17 sam0x17 mentioned this pull request Oct 25, 2024
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.

Ban U256::as_u64 and similar functions

3 participants