Skip to content

Commit 032b8f4

Browse files
alexpovelanonrig
authored andcommitted
docs: Use unused Result
`set_port` returns a `Result` we `must_use`. Fixes the compiler warning.
1 parent 16f3467 commit 032b8f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ Here is an example illustrating a common usage:
1212

1313
```Rust
1414
use ada_url::Url;
15-
fn main() {
15+
fn main() -> Result<(), ()> {
1616
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(Some("9999"));
21+
u.set_port(Some("9999"))?;
2222
println!("href: {:?}", u.href());
23+
24+
Ok(())
2325
}
2426
```
2527

0 commit comments

Comments
 (0)