From 5d87dbdf88982867d1dcaf105b7a68d53f063942 Mon Sep 17 00:00:00 2001 From: jazzfool Date: Sat, 21 Sep 2024 13:27:33 +1000 Subject: [PATCH] update lib docs --- src/lib.rs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3d7a9bc..f0fde9a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,33 +8,25 @@ //! Example: //! ```rust //! use iced_video_player::{Video, VideoPlayer}; -//! use iced::{Sandbox, Element}; //! -//! # #![allow(clippy::needless_doctest_main)] -//! fn main() { -//! App::run(Default::default()); +//! fn main() -> iced::Result { +//! iced::run("Video Player", (), App::view) //! } //! //! struct App { //! video: Video, //! } //! -//! impl Sandbox for App { -//! type Message = (); -//! -//! fn new() -> Self { +//! impl Default for App { +//! fn default() -> Self { //! App { //! video: Video::new(&url::Url::parse("file:///C:/my_video.mp4").unwrap()).unwrap(), //! } //! } +//! } //! -//! fn title(&self) -> String { -//! String::from("Video Player") -//! } -//! -//! fn update(&mut self, _message: ()) {} -//! -//! fn view(&mut self) -> Element<()> { +//! impl App { +//! fn view(&self) -> iced::Element<()> { //! VideoPlayer::new(&self.video).into() //! } //! }