Skip to main content

has_extension

Function has_extension 

Source
pub fn has_extension(uri: &str, extension: &str) -> bool
Expand description

Does the given URI end with the given file extension?

The comparison ignores ASCII case and any #fragment at the end of the URI, so has_extension("cat.GIF#frame=2", "gif") is true.

This is useful when implementing an ImageLoader.