File tree 1 file changed +15
-12
lines changed
1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
# Gravatar API Client for Rust
2
2
3
+ A small library to access the Gravatar API,
4
+ inspired by [ rust-gravatar] ( https://github.com/chowdhurya/rust-gravatar/ ) .
5
+
3
6
## Example Usage
4
7
5
8
``` rust
9
+ extern crate gravatar_api;
6
10
use gravatar_api :: avatars;
7
11
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
+ ```
You can’t perform that action at this time.
0 commit comments