Skip to content

Commit 7f75d1c

Browse files
committed
Add more display examples to README and documentation
1 parent 323ba48 commit 7f75d1c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ use query_string_builder::QueryString;
1111
fn main() {
1212
let qs = QueryString::new()
1313
.with_value("q", "apple")
14+
.with_value("tasty", true)
1415
.with_opt_value("color", None::<String>)
1516
.with_opt_value("category", Some("fruits and vegetables?"));
1617

1718
assert_eq!(
1819
format!("https://example.com/{qs}"),
19-
"https://example.com/?q=apple&category=fruits%20and%20vegetables?"
20+
"https://example.com/?q=apple&tasty=true&category=fruits%20and%20vegetables?&tasty=true"
2021
);
2122
}
2223
```

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
//!
1111
//! let qs = QueryString::new()
1212
//! .with_value("q", "🍎 apple")
13+
//! .with_value("tasty", true)
1314
//! .with_opt_value("color", None::<String>)
1415
//! .with_opt_value("category", Some("fruits and vegetables?"));
1516
//!
1617
//! assert_eq!(
1718
//! format!("example.com/{qs}"),
18-
//! "example.com/?q=%F0%9F%8D%8E%20apple&category=fruits%20and%20vegetables?"
19+
//! "example.com/?q=%F0%9F%8D%8E%20apple&tasty=true&category=fruits%20and%20vegetables?"
1920
//! );
2021
//! ```
2122

0 commit comments

Comments
 (0)