Skip to content

Commit 87c0320

Browse files
committed
use const for hardcoded URL
1 parent 87189a2 commit 87c0320

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ fn main() {
9696
);
9797

9898
let json = serde_json::to_string(&reading).unwrap();
99-
let url = "http://localhost:4000/api/readings/add";
99+
const URL: &str = "http://localhost:4000/api/readings/add";
100100

101-
println!("Sending POST request to {} as JSON: {}", url, json);
101+
println!("Sending POST request to {} as JSON: {}", URL, json);
102102

103103
let client = Client::new();
104-
let res = client.post(url)
104+
let res = client.post(URL)
105105
.body(json)
106106
.send();
107107

0 commit comments

Comments
 (0)