commit e6ba91a0d9d43230842fe71205d8ddc379db5e79 from: Murilo Ijanc date: Thu Apr 9 17:47:53 2026 UTC add ci target with fmt-check and clippy commit - 8e4d062a47b7003064cb9ff22232e4e9b804571b commit + e6ba91a0d9d43230842fe71205d8ddc379db5e79 blob - ffaf97ed9dd4c2c3e5388126b167e66e9e946c6a blob + df99c69198f5813df5fc3eaa007a2af0e60a7bbd --- .rustfmt.toml +++ .rustfmt.toml @@ -1,2 +1 @@ max_width = 80 -imports_granularity = "Crate" blob - d2ec20164094efd0e477d21bf80afb2959c68e90 blob + 9f878a656005bbfc4d0bfe78e21c7086bf3570df --- Makefile +++ Makefile @@ -9,8 +9,11 @@ BIN = $(BUILD)/asp MAIN = asp.rs -.PHONY: all clean install +CLIPPY ?= $(shell rustup which clippy-driver 2>/dev/null) +RUSTFMT ?= $(shell rustup which rustfmt 2>/dev/null) +.PHONY: all clean install ci fmt-check clippy + all: $(BIN) $(BIN): $(MAIN) @@ -28,3 +31,14 @@ install: $(BIN) install -m 755 $(BIN) $(PREFIX)/bin/asp install -m 644 asp.1 $(MANDIR)/man1/asp.1 +fmt-check: + $(RUSTFMT) --edition 2024 --check $(MAIN) + +clippy: + ASP_VERSION=$(VERSION) $(CLIPPY) --edition 2024 \ + --crate-type bin --crate-name asp \ + -L $(BUILD) -l tls \ + -W clippy::all $(MAIN) + +ci: fmt-check clippy $(BIN) + blob - ef5baa7e0c6d3d1cbb5673ba4f4a8e308cb42714 blob + 6fefc38a711e08fa55a93e19099b05272ef6704a --- asp.rs +++ asp.rs @@ -77,25 +77,14 @@ mod ffi { pub fn tls_config_new() -> *mut TlsCfg; pub fn tls_config_free(cfg: *mut TlsCfg); pub fn tls_client() -> *mut Tls; - pub fn tls_configure( - ctx: *mut Tls, - cfg: *mut TlsCfg, - ) -> c_int; + pub fn tls_configure(ctx: *mut Tls, cfg: *mut TlsCfg) -> c_int; pub fn tls_connect_socket( ctx: *mut Tls, fd: c_int, name: *const c_char, ) -> c_int; - pub fn tls_read( - ctx: *mut Tls, - buf: *mut u8, - len: usize, - ) -> isize; - pub fn tls_write( - ctx: *mut Tls, - buf: *const u8, - len: usize, - ) -> isize; + pub fn tls_read(ctx: *mut Tls, buf: *mut u8, len: usize) -> isize; + pub fn tls_write(ctx: *mut Tls, buf: *const u8, len: usize) -> isize; pub fn tls_close(ctx: *mut Tls) -> c_int; pub fn tls_free(ctx: *mut Tls); pub fn tls_error(ctx: *mut Tls) -> *const c_char;