From cb992274c7e2d17d5a92496d5fa7088eca467e42 Mon Sep 17 00:00:00 2001 From: rskntroot Date: Sat, 27 Jul 2024 04:28:17 +0000 Subject: [PATCH] init cargo fmt; readme++ --- README.md | 16 ++++++++++++++++ src/main.rs | 6 +----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0c8dab4..7493194 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,22 @@ $ r53-ddns -z ${aws_dns_zone_id} -d example.com. The DNS record is currently up to date with the public IP: 10.0.88.219 ``` +### Tests + +Yeah, I have em! Well... one of them. + +``` +$ cargo test + Compiling r53-ddns v0.1.0 (~/workspace/r53-ddns) + Finished `test` profile [unoptimized + debuginfo] target(s) in 3.81s + Running unittests src/main.rs (target/debug/deps/r53_ddns-9ff92b89721daeea) + +running 1 test +test tests::get_public_ip_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s +``` + ## Q&A > Why are you doing AWS calls instead of us nslookup and compare that? diff --git a/src/main.rs b/src/main.rs index 0308106..f39397b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -138,11 +138,7 @@ async fn main() -> Result<(), Box> { // Check the status of the change request every 60 seconds loop { - let change_response = client - .get_change() - .id(&change_id) - .send() - .await?; + let change_response = client.get_change().id(&change_id).send().await?; // check the status if let Some(change_info) = change_response.change_info {