Add has_url()

This commit is contained in:
topecongiro 2017-10-31 15:07:19 +09:00
parent bc31014423
commit 38399875b8

View File

@ -349,6 +349,12 @@ fn rewrite_comment_inner(
Some(result)
}
/// Returns true if the given string MAY include URLs or alike.
fn has_url(s: &str) -> bool {
// This function may return false positive, but should get its job done in most cases.
s.contains("https://") || s.contains("http://")
}
/// Given the span, rewrite the missing comment inside it if available.
/// Note that the given span must only include comments (or leading/trailing whitespaces).
pub fn rewrite_missing_comment(