about summary refs log tree commit diff stats
path: root/crates/libmpv2/src/mpv.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libmpv2/src/mpv.rs')
-rw-r--r--crates/libmpv2/src/mpv.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/libmpv2/src/mpv.rs b/crates/libmpv2/src/mpv.rs
index bf4581e..07d0976 100644
--- a/crates/libmpv2/src/mpv.rs
+++ b/crates/libmpv2/src/mpv.rs
@@ -566,15 +566,21 @@ impl Mpv {
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```dont_run
     /// # use libmpv2::{Mpv};
     /// # use libmpv2::mpv_node::MpvNode;
+    /// # use libmpv2::mpv::errors::Result;
     /// # use std::collections::HashMap;
+    /// #
+    /// # fn main() -> Result<()> {
+    /// # let mpv = Mpv::new()?;
     /// mpv.command("loadfile", &["test-data/jellyfish.mp4", "append-play"]).unwrap();
     /// # let node = mpv.get_property::<MpvNode>("playlist").unwrap();
     /// # let mut list = node.array().unwrap().collect::<Vec<_>>();
     /// # let map = list.pop().unwrap().map().unwrap().collect::<HashMap<_, _>>();
     /// # assert_eq!(map, HashMap::from([(String::from("id"), MpvNode::Int64(1)), (String::from("current"), MpvNode::Flag(true)), (String::from("filename"), MpvNode::String(String::from("test-data/jellyfish.mp4")))]));
+    /// # Ok(())
+    /// # }
     /// ```
     pub fn command(&self, name: &str, args: &[&str]) -> Result<()> {
         let mut cmd = name.to_owned();