You've already forked rust-crate
Lints and build commands
This commit is contained in:
@@ -8,9 +8,15 @@ license-file = "LICENSE.md"
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
rust-version = "1.85.0"
|
rust-version = "1.85.0"
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
[lints.rust]
|
[lints.rust]
|
||||||
arithmetic_overflow = "forbid"
|
arithmetic_overflow = "forbid"
|
||||||
|
missing_docs = "forbid"
|
||||||
unsafe_code = "forbid"
|
unsafe_code = "forbid"
|
||||||
|
unused_doc_comments = "forbid"
|
||||||
|
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
arithmetic_side_effects = "forbid"
|
arithmetic_side_effects = "forbid"
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
# Crate Template
|
# Crate Template
|
||||||
|
|
||||||
Make sure not to keep git history when copying this template
|
Make sure not to keep git history when copying this template
|
||||||
|
|
||||||
|
## Various builds
|
||||||
|
|
||||||
|
- build: `cargo hack --feature-powerset build`
|
||||||
|
- clippy: `cargo hack --feature-powerset clippy -- -D warnings`
|
||||||
|
- test: `cargo hack --feature-powerset test`
|
||||||
|
- test old: `cargo +1.85 hack --feature-powerset test`
|
||||||
|
- miri: `cargo +nightly hack --feature-powerset miri test`
|
||||||
|
- example: `cargo run --example=<example> --features=<req_features>`
|
||||||
|
- fmt: `cargo fmt --check`
|
||||||
|
- docs: `RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features`
|
||||||
|
- install: `cargo install --path <path>`
|
||||||
|
- semver: `cargo semver-checks --all-features`
|
||||||
|
- publish: `cargo publish --dry-run -p <crate>`
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
//! Module
|
||||||
|
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
// #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
|
||||||
|
|
||||||
|
/// Add function
|
||||||
pub fn add(left: usize, right: usize) -> usize {
|
pub fn add(left: usize, right: usize) -> usize {
|
||||||
left.wrapping_add(right)
|
left.wrapping_add(right)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user