Skip to content

Commit 742a6d2

Browse files
lemireanonrig
authored andcommitted
Adding minimal documentation
1 parent 0248030 commit 742a6d2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,25 @@
22

33
Fast [WHATWG specification](https://url.spec.whatwg.org) compliant URL parser for Rust.
44

5+
### Usage
6+
7+
Add the following as a dependency to your project (`Cargo.toml`):
8+
9+
```
10+
[dependencies]
11+
ada-url = { git = "https://github.com/ada-url/rust" }
12+
```
13+
14+
Here is an example illustrating a common usage:
15+
```Rust
16+
use ada_url::Url;
17+
fn main() {
18+
let mut u = Url::parse("http://www.google:8080/love#drug", None).expect("bad url");
19+
println!("port: {:?}", u.port());
20+
println!("hash: {:?}", u.hash());
21+
println!("pathname: {:?}", u.pathname());
22+
println!("href: {:?}", u.href());
23+
u.set_port("9999");
24+
println!("href: {:?}", u.href());
25+
}
26+
```

0 commit comments

Comments
 (0)