File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ use query_string_builder::QueryString;
1111fn 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```
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments