Skip to content

Commit

Permalink
fix the rust docs examples
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Dec 14, 2020
1 parent a80cde4 commit fb31766
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions dropshot/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use std::net::SocketAddr;
* r##"
* [http_api_server]
* bind_address = "127.0.0.1:12345"
* request_body_max_bytes = 1024
*
* ## ... (other app-specific config)
* "##
Expand Down
1 change: 1 addition & 0 deletions dropshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
* HttpServer::new(
* &ConfigDropshot {
* bind_address: "127.0.0.1:0".parse().unwrap(),
* request_body_max_bytes: 1024,
* },
* api,
* Arc::new(()),
Expand Down
13 changes: 9 additions & 4 deletions dropshot/tests/test_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ async fn test_config_bind_address() {
* don't want to depend on too much from the ApiServer here -- but we
* should have successfully made the request.)
*/
let config_text =
format!("bind_address = \"{}:{}\"\nrequest_body_max_bytes = 1024", bind_ip_str, bind_port);
let config_text = format!(
"bind_address = \"{}:{}\"\nrequest_body_max_bytes = 1024",
bind_ip_str, bind_port
);
let config =
read_config::<ConfigDropshot>("bind_address", &config_text).unwrap();
let mut server = make_server(&config, &log);
Expand All @@ -138,8 +140,11 @@ async fn test_config_bind_address() {
* Start a server on another TCP port and make sure we can reach that
* one (and NOT the one we just shut down).
*/
let config_text =
format!("bind_address = \"{}:{}\"\nrequest_body_max_bytes = 1024", bind_ip_str, bind_port + 1,);
let config_text = format!(
"bind_address = \"{}:{}\"\nrequest_body_max_bytes = 1024",
bind_ip_str,
bind_port + 1,
);
let config =
read_config::<ConfigDropshot>("bind_address", &config_text).unwrap();
let mut server = make_server(&config, &log);
Expand Down

0 comments on commit fb31766

Please sign in to comment.