Skip to content

Commit 16f3467

Browse files
alexpovelanonrig
authored andcommitted
docs: Fix sample code
In a new project, after `cargo add ada-url`, now compiles successfully
1 parent be5c260 commit 16f3467

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Here is an example illustrating a common usage:
1313
```Rust
1414
use ada_url::Url;
1515
fn main() {
16-
let u = Url::parse("http://www.google:8080/love#drug", None).expect("bad url");
16+
let mut u = Url::parse("http://www.google:8080/love#drug", None).expect("bad url");
1717
println!("port: {:?}", u.port());
1818
println!("hash: {:?}", u.hash());
1919
println!("pathname: {:?}", u.pathname());
2020
println!("href: {:?}", u.href());
21-
u.set_port("9999");
21+
u.set_port(Some("9999"));
2222
println!("href: {:?}", u.href());
2323
}
2424
```

0 commit comments

Comments
 (0)