Merge branch 'lint' into 'main'

Add fmt job to CI

See merge request veilid/veilid!310
This commit is contained in:
Christien Rioux 2024-08-11 17:38:00 +00:00
commit 672ad87d28
14 changed files with 44 additions and 31 deletions

View File

@ -11,6 +11,23 @@ stages:
- release - release
- distribute - distribute
format:
stage: test
image: rust:latest
before_script:
- rustup component add rustfmt
script:
- cargo fmt --all -- --check --verbose
cache:
key: fmt-cache
paths:
- ~/.cargo/bin/
- ~/.cargo/git/db/
- ~/.cargo/registry/cache/
- ~/.cargo/registry/index/
# base earthly setup for jobs # base earthly setup for jobs
.base: .base:
tags: [ saas-linux-medium-amd64 ] tags: [ saas-linux-medium-amd64 ]

View File

@ -310,7 +310,6 @@ impl NetworkConnection {
let sender_fut = receiver.recv_async().then(|res| async { let sender_fut = receiver.recv_async().then(|res| async {
match res { match res {
Ok((_span_id, message)) => { Ok((_span_id, message)) => {
// Touch the LRU for this connection // Touch the LRU for this connection
connection_manager.touch_connection_by_id(connection_id); connection_manager.touch_connection_by_id(connection_id);
@ -378,7 +377,6 @@ impl NetworkConnection {
log_net!(debug "failed to process received envelope: {}", e); log_net!(debug "failed to process received envelope: {}", e);
RecvLoopAction::Finish RecvLoopAction::Finish
} else { } else {
// Touch the LRU for this connection // Touch the LRU for this connection
connection_manager.touch_connection_by_id(connection_id); connection_manager.touch_connection_by_id(connection_id);
@ -442,7 +440,6 @@ impl NetworkConnection {
if let Err(e) = protocol_connection.close().await { if let Err(e) = protocol_connection.close().await {
log_net!(debug "Protocol connection close error: {}", e); log_net!(debug "Protocol connection close error: {}", e);
} }
}.in_current_span()) }.in_current_span())
} }

View File

@ -93,7 +93,6 @@ impl NetworkManager {
target_node_ref, target_node_ref,
relay_nr, relay_nr,
); );
} }
| NodeContactMethod::InboundRelay(relay_nr) => { | NodeContactMethod::InboundRelay(relay_nr) => {
// Relay loop or multiple relays // Relay loop or multiple relays

View File

@ -177,7 +177,6 @@ impl StorageManager {
// Send an update since the value changed // Send an update since the value changed
ctx.send_partial_update = true; ctx.send_partial_update = true;
} }
// Return peers if we have some // Return peers if we have some
log_network_result!(debug "GetValue fanout call returned peers {}", gva.answer.peers.len()); log_network_result!(debug "GetValue fanout call returned peers {}", gva.answer.peers.len());

View File

@ -145,7 +145,6 @@ impl StorageManager {
// If we got a value back it should be different than the one we are setting // If we got a value back it should be different than the one we are setting
// But in the case of a benign bug, we can just move to the next node // But in the case of a benign bug, we can just move to the next node
if ctx.value.value_data() == value.value_data() { if ctx.value.value_data() == value.value_data() {
ctx.value_nodes.push(next_node); ctx.value_nodes.push(next_node);
ctx.missed_since_last_set = 0; ctx.missed_since_last_set = 0;

View File

@ -210,6 +210,7 @@ pub async fn test_protect_unprotect(vcrypto: CryptoSystemVersion, ts: TableStore
0, 0, 0, 0, 0, 0,
]), ]),
); );
let dek2 = TypedSharedSecret::new( let dek2 = TypedSharedSecret::new(
vcrypto.kind(), vcrypto.kind(),
SharedSecret::new([ SharedSecret::new([
@ -217,6 +218,7 @@ pub async fn test_protect_unprotect(vcrypto: CryptoSystemVersion, ts: TableStore
0, 0, 0xFF, 0, 0, 0xFF,
]), ]),
); );
let dek3 = TypedSharedSecret::new( let dek3 = TypedSharedSecret::new(
vcrypto.kind(), vcrypto.kind(),
SharedSecret::new([0x80u8; SHARED_SECRET_LENGTH]), SharedSecret::new([0x80u8; SHARED_SECRET_LENGTH]),