update comments

This commit is contained in:
yggverse 2024-11-01 05:05:41 +02:00
parent fc48a08be9
commit 7d837c552b

View file

@ -50,7 +50,7 @@ impl Mime {
} }
} }
/// Create new `Self` from `std::Path` /// Create new `Self` from `std::Path` that includes file **extension**
pub fn from_path(path: &Path) -> Result<Self, Error> { pub fn from_path(path: &Path) -> Result<Self, Error> {
match path.extension().and_then(|extension| extension.to_str()) { match path.extension().and_then(|extension| extension.to_str()) {
// Text // Text
@ -123,6 +123,7 @@ impl Mime {
} }
/// Create new `Self` from [Uri](https://docs.gtk.org/glib/struct.Uri.html) /// Create new `Self` from [Uri](https://docs.gtk.org/glib/struct.Uri.html)
/// that includes file **extension**
pub fn from_uri(uri: &Uri) -> Result<Self, Error> { pub fn from_uri(uri: &Uri) -> Result<Self, Error> {
Self::from_path(Path::new(&uri.to_string())) Self::from_path(Path::new(&uri.to_string()))
} }