aboutsummaryrefslogtreecommitdiff
path: root/src/builder/edit_profile.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-02 14:33:23 +0200
committeracdenisSK <[email protected]>2017-07-02 18:29:29 +0200
commit511ec87280e8ddec6589f48fec8260bf2e598bdb (patch)
tree008846c1531ecd47887abb9623b98a960b1fa808 /src/builder/edit_profile.rs
parentAdd a `quit` function` (diff)
downloadserenity-511ec87280e8ddec6589f48fec8260bf2e598bdb.tar.xz
serenity-511ec87280e8ddec6589f48fec8260bf2e598bdb.zip
Fix doc tests
Diffstat (limited to 'src/builder/edit_profile.rs')
-rw-r--r--src/builder/edit_profile.rs29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/builder/edit_profile.rs b/src/builder/edit_profile.rs
index 7a3a522..2b54f68 100644
--- a/src/builder/edit_profile.rs
+++ b/src/builder/edit_profile.rs
@@ -19,23 +19,26 @@ impl EditProfile {
/// image from a file and return its contents in base64-encoded form:
///
/// ```rust,no_run
- /// # use serenity::Client;
+ /// # use serenity::prelude::*;
+ /// # use serenity::model::*;
/// #
- /// # let mut client = Client::new("");
- /// #
- /// # client.on_message(|context, _| {
- /// #
- /// use serenity::utils;
+ /// # struct Handler;
+ /// # impl EventHandler for Handler {
+ /// # fn on_message(&self, context: Context, _: Message) {
+ /// use serenity::utils;
///
- /// // assuming a `context` has been bound
+ /// // assuming a `context` has been bound
///
- /// let base64 = utils::read_image("./my_image.jpg")
- /// .expect("Failed to read image");
+ /// let base64 = utils::read_image("./my_image.jpg")
+ /// .expect("Failed to read image");
///
- /// let _ = context.edit_profile(|profile| {
- /// profile.avatar(Some(&base64))
- /// });
- /// # });
+ /// let _ = context.edit_profile(|profile| {
+ /// profile.avatar(Some(&base64))
+ /// });
+ /// # }
+ /// }
+
+ /// # let mut client = Client::new("token", Handler); client.start().unwrap();
/// ```
///
/// [`utils::read_image`]: ../fn.read_image.html