Skip to content

Commit 660a75b

Browse files
committed
crc-fast-rust: cleaned up the old branches; added a 'check' shell script to avoid breaking the Make file.
1 parent 2b1e6d2 commit 660a75b

File tree

3 files changed

+42
-11
lines changed

3 files changed

+42
-11
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
.DS_Store
66
.git
77
.vscode
8-
walkthrough.md
8+
/scripts

Cargo.toml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,39 @@ indexmap = { version = ">=2.11.0, <2.12.0", optional = true }
3737
# no_std support
3838
# spin is optional - only needed on architectures with SIMD (for feature detection)
3939
# or when cache feature is enabled
40-
spin = { version = "0.10.0", default-features = false, features = ["once", "rwlock", "mutex", "spin_mutex"], optional = true }
40+
spin = { version = "0.10.0", default-features = false, features = [
41+
"once",
42+
"rwlock",
43+
"mutex",
44+
"spin_mutex",
45+
], optional = true }
4146
# hashbrown is only needed when caching is enabled in no_std
4247
hashbrown = { version = "0.16.0", optional = true }
4348

4449
# Target-specific dependencies: spin is needed for feature detection on SIMD-capable architectures
4550
[target.'cfg(target_arch = "aarch64")'.dependencies]
46-
spin = { version = "0.10.0", default-features = false, features = ["once", "rwlock", "mutex", "spin_mutex"] }
51+
spin = { version = "0.10.0", default-features = false, features = [
52+
"once",
53+
"rwlock",
54+
"mutex",
55+
"spin_mutex",
56+
] }
4757

4858
[target.'cfg(target_arch = "x86")'.dependencies]
49-
spin = { version = "0.10.0", default-features = false, features = ["once", "rwlock", "mutex", "spin_mutex"] }
59+
spin = { version = "0.10.0", default-features = false, features = [
60+
"once",
61+
"rwlock",
62+
"mutex",
63+
"spin_mutex",
64+
] }
5065

5166
[target.'cfg(target_arch = "x86_64")'.dependencies]
52-
spin = { version = "0.10.0", default-features = false, features = ["once", "rwlock", "mutex", "spin_mutex"] }
67+
spin = { version = "0.10.0", default-features = false, features = [
68+
"once",
69+
"rwlock",
70+
"mutex",
71+
"spin_mutex",
72+
] }
5373

5474
[dev-dependencies]
5575
criterion = "0.7"
@@ -91,11 +111,16 @@ default = ["std", "panic-handler", "ffi"]
91111
std = ["alloc"] # std implies alloc is available
92112
alloc = ["digest"] # marker feature for heap allocation support
93113
panic-handler = [] # Provides panic handler for no_std library checks (disable in binaries)
94-
ffi = [] # C/C++ compatible dynamic/static library, planned to become optional in the next MAJOR version (v2) to reduce overhead
114+
ffi = [
115+
] # C/C++ compatible dynamic/static library, planned to become optional in the next MAJOR version (v2) to reduce overhead
95116

96117
# optional features
97118
cli = ["std"] # command line interface binaries (checksum, arch-check, get-custom-params)
98-
cache = ["alloc", "hashbrown", "spin"] # no_std caching requires alloc + hashbrown HashMap + spin for synchronization
119+
cache = [
120+
"alloc",
121+
"hashbrown",
122+
"spin",
123+
] # no_std caching requires alloc + hashbrown HashMap + spin for synchronization
99124

100125
# the features below are deprecated, aren't in use, and will be removed in the next MAJOR version (v2)
101126
vpclmulqdq = [] # deprecated, VPCLMULQDQ stabilized in Rust 1.89.0

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ ifeq ($(UNAME_S),Linux)
1414
POST_INSTALL := ldconfig
1515
else ifeq ($(UNAME_S),Darwin)
1616
DESTDIR ?=
17-
# on macOS, there's not really a default location, so require DESTDIR
18-
ifeq ($(DESTDIR),)
19-
$(error On macOS, DESTDIR must be set for installation. Common locations include /usr/local or /opt/homebrew)
20-
endif
2117
LIB_EXTENSION := dylib
2218
STATIC_LIB_EXTENSION := a
2319
INSTALL_LIB_DIR := /lib
@@ -96,6 +92,16 @@ uninstall: print-paths
9692
ldconfig; \
9793
fi
9894

95+
# Run all code quality checks
96+
.PHONY: check
97+
check:
98+
cargo fmt --all
99+
cargo check --workspace --all-targets --all-features
100+
cargo clippy --workspace --all-targets --all-features --fix --allow-dirty -- -D warnings
101+
# cargo deny check all
102+
# RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-features
103+
# cargo audit
104+
99105
# Clean build artifacts
100106
.PHONY: clean
101107
clean:

0 commit comments

Comments
 (0)