Fix doc warnings

pull/329/head
Ivan Tham 3 years ago
parent eaf259f8aa
commit 985625763a

@ -178,13 +178,13 @@ pub trait AnyComponent {
/// Returns a boxed any from a boxed self.
///
/// Can be used before `Box::downcast()`.
///
/// # Examples
///
/// ```rust
/// // let boxed: Box<Component> = Box::new(TextComponent::new("text"));
/// // let text: Box<TextComponent> = boxed.as_boxed_any().downcast().unwrap();
/// ```
//
// # Examples
//
// ```rust
// let boxed: Box<Component> = Box::new(TextComponent::new("text"));
// let text: Box<TextComponent> = boxed.as_boxed_any().downcast().unwrap();
// ```
fn as_boxed_any(self: Box<Self>) -> Box<dyn Any>;
}

@ -44,7 +44,7 @@
//! implement your own.
//!
//! Each widget follows a builder pattern API providing a default configuration along with methods
//! to customize them. The widget is then rendered using the [`Frame::render_widget`] which take
//! to customize them. The widget is then rendered using the `Frame::render_widget` which take
//! your widget instance an area to draw to.
//!
//! The following example renders a block of the size of the terminal:

@ -1,4 +1,4 @@
//! `widgets` is a collection of types that implement [`Widget`] or [`StatefulWidget`] or both.
//! `widgets` is a collection of types that implement [`Widget`].
//!
//! All widgets are implemented using the builder pattern and are consumable objects. They are not
//! meant to be stored but used as *commands* to draw common figures in the UI.

@ -165,7 +165,7 @@ pub fn fold_home_dir(path: &Path) -> PathBuf {
/// [`std::fs::canonicalize`] can be hard to use correctly, since it can often
/// fail, or on Windows returns annoying device paths. This is a problem Cargo
/// needs to improve on.
/// Copied from cargo: https://github.com/rust-lang/cargo/blob/070e459c2d8b79c5b2ac5218064e7603329c92ae/crates/cargo-util/src/paths.rs#L81
/// Copied from cargo: <https://github.com/rust-lang/cargo/blob/070e459c2d8b79c5b2ac5218064e7603329c92ae/crates/cargo-util/src/paths.rs#L81>
pub fn normalize_path(path: &Path) -> PathBuf {
let path = expand_tilde(path);
let mut components = path.components().peekable();

Loading…
Cancel
Save