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

Forbid unsafe code #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

link2xt
Copy link

@link2xt link2xt commented Jun 15, 2020

This makes cargo geiger happy.

This makes `cargo geiger` happy.
@@ -165,6 +165,8 @@
//! buffer or `Reader` (thanks to the change of `Value::Undefined`
//! and `Value::Ascii` described above).

#![forbid(unsafe_code)]
Copy link

@itudoben itudoben Jun 11, 2021

Choose a reason for hiding this comment

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

Any reason why unsafe code should be forbidden?

From geiger crate author, it looks like it's up to the user to decide.
It is, however, the opinion of the author of this project that libraries choosing to abstain from unsafe Rust usage when possible should be promoted.

Copy link

Choose a reason for hiding this comment

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

If you don't use unsafe code, then you should forbid it, as it makes cargo geiger's job easier, it makes it clearer that you're not using unsafe anywhere, and there are some things that are unsafe but you don't put an unsafe keyword around, and forbid(unsafe_code) forbids those.

Of course, if you do need unsafe code for a good reason, you can't do that.

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