cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.64k stars 1.12k forks source link

Quick Start: load balancer small doc code snippet typo #45

Closed kristianpaul closed 5 months ago

kristianpaul commented 5 months ago

Describe the bug

There is a typo on the Quick Start: load balancer rust snippet line

        println!("upstream peer is: {:upstream?}");

Pingora info

Please include the following information about your environment:

Pingora version 8797329225018c4d0ab990166dd020338ae292dc Rust version: i.e. cargo --version Operating system version: Debian 12.4

Steps to reproduce

Follow quick start guide example for load balancer

Expected results

cargo run to build and run project

Observed results

What actually happened

error: invalid format string: expected `'}'`, found `'?'`
  --> src/main.rs:21:47
   |
21 |         println!("upstream peer is: {:upstream?}");
   |                                     -         ^ expected `'}'` in format string
   |                                     |
   |                                     because of this opening brace
   |
   = note: if you intended to print `{`, you can escape it using `{{`

Additional context

Just trying to use pingora from a quick start documentation

kristianpaul commented 5 months ago

@eaufavor This needs to be open , the aforementioned PR doesn't solve the reported issues as March 4th 2024

paul@rock0:~/load_balancer $ cargo run
   Compiling load_balancer v0.1.0 (/mnt/home/pi/load_balancer)
error: invalid format string: expected `'}'`, found `'?'`
  --> src/main.rs:36:47
   |
36 |         println!("upstream peer is: {:upstream?}");
   |                                     -         ^ expected `'}'` in format string
   |                                     |
   |                                     because of this opening brace
   |
   = note: if you intended to print `{`, you can escape it using `{{`

error: could not compile `load_balancer` (bin "load_balancer") due to 1 previous error
paul@rock0:~/load_balancer $ date
Mon Mar  4 03:49:51 PM UTC 2024
paul@rock0:~/load_balancer $