Skip to content

Commit

Permalink
Merge pull request #324 from ethanpailes/document-image-format-guessing
Browse files Browse the repository at this point in the history
document that img handle constructors guess fmt
  • Loading branch information
hecrj authored Apr 27, 2020
2 parents 3f4770f + da2ab42 commit e0aa89c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions native/src/widget/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ pub struct Handle {
impl Handle {
/// Creates an image [`Handle`] pointing to the image of the given path.
///
/// Makes an educated guess about the image format by examining the data in the file.
///
/// [`Handle`]: struct.Handle.html
pub fn from_path<T: Into<PathBuf>>(path: T) -> Handle {
Self::from_data(Data::Path(path.into()))
Expand All @@ -145,6 +147,8 @@ impl Handle {

/// Creates an image [`Handle`] containing the image data directly.
///
/// Makes an educated guess about the image format by examining the given data.
///
/// This is useful if you already have your image loaded in-memory, maybe
/// because you downloaded or generated it procedurally.
///
Expand Down

0 comments on commit e0aa89c

Please sign in to comment.