fix(ci): gate event crate doctest behind mem feature and apply rustfmt

The crate-root doctest used InMemoryEventBus/TypedEventBus (gated behind
the 'mem' feature), so `cargo test -p mytheclipse-event --no-default-features
--features amqp|nats` failed to compile the doctest (E0432). The example is
now no_run with the mem-dependent imports inside a #[cfg(feature="mem")]
main, so it compiles (and runs) when mem is on and degrades to an empty main
when off.

Also apply rustfmt to mytheclipse-config/dynamic.rs and
mytheclipse-storage/{gcs,s3}.rs to satisfy cargo fmt --all --check.
This commit is contained in:
asepharyana
2026-08-28 22:41:06 +07:00
parent b2d3f32d83
commit 19941156b4
4 changed files with 34 additions and 14 deletions
+4 -1
View File
@@ -160,6 +160,9 @@ mod tests {
.await
.unwrap();
assert_eq!(data, b"hello gcs");
storage.delete("mytheclipse-storage-test.txt").await.unwrap();
storage
.delete("mytheclipse-storage-test.txt")
.await
.unwrap();
}
}
+10 -3
View File
@@ -52,7 +52,8 @@ impl S3Storage {
access_key: &str,
secret_key: &str,
) -> Self {
let credentials = Credentials::new(access_key, secret_key, None, None, "mytheclipse-storage");
let credentials =
Credentials::new(access_key, secret_key, None, None, "mytheclipse-storage");
let config = aws_sdk_s3::Config::builder()
.region(Region::new(region.to_string()))
.endpoint_url(endpoint)
@@ -322,13 +323,19 @@ mod tests {
.await;
storage
.put("mytheclipse-storage-test.txt", bytes_stream(b"hello s3".to_vec()))
.put(
"mytheclipse-storage-test.txt",
bytes_stream(b"hello s3".to_vec()),
)
.await
.unwrap();
let data = read_to_vec(storage.get("mytheclipse-storage-test.txt").await.unwrap())
.await
.unwrap();
assert_eq!(data, b"hello s3");
storage.delete("mytheclipse-storage-test.txt").await.unwrap();
storage
.delete("mytheclipse-storage-test.txt")
.await
.unwrap();
}
}