Skip to content

Commit e3de0ba

Browse files
committed
Update README.md.
Signed-off-by: Benjamin P. Jung <[email protected]>
1 parent 6628f11 commit e3de0ba

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

README.md

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# Gravatar API Client for Rust
22

3+
A small library to access the Gravatar API,
4+
inspired by [rust-gravatar](https://github.com/chowdhurya/rust-gravatar/).
5+
36
## Example Usage
47

58
```rust
9+
extern crate gravatar_api;
610
use gravatar_api::avatars;
711

8-
fn main() {
9-
println!(
10-
"{}",
11-
avatars::Avatar::builder("[email protected]")
12-
.size(512)
13-
.default(avatars::Default::RoboHash)
14-
.rating(avatars::Rating::G)
15-
.build()
16-
.image_url()
17-
);
18-
}
19-
``
12+
let url = avatars::Avatar::builder("[email protected]")
13+
.size(512)
14+
.default(avatars::Default::RoboHash)
15+
.rating(avatars::Rating::G)
16+
.build()
17+
.image_url();
18+
assert_eq!(
19+
url.as_str(),
20+
"https://www.gravatar.com/avatar/836f82db99121b3481011f16b49dfa5fbc714a0d1b1b9f784a1ebbbf5b39577f?s=512&r=g&d=robohash"
21+
);
22+
```

0 commit comments

Comments
 (0)