fn line_is_url(line: &str) -> bool {
    use self::LIUState::*;
    let mut state: LIUState = EXP_COMMENT_START;

    for tok in line.split_whitespace() {
        match (state, tok) {
            (EXP_COMMENT_START, "//") => state = EXP_LINK_LABEL_OR_URL,
            (EXP_COMMENT_START, "///") => state = EXP_LINK_LABEL_OR_URL,
            (EXP_COMMENT_START, "//!") => state = EXP_LINK_LABEL_OR_URL,

            (EXP_LINK_LABEL_OR_URL, w)
                if w.len() >= 4 && w.starts_with("[") && w.ends_with("]:")
                => state = EXP_URL,

            (EXP_LINK_LABEL_OR_URL, w)
                if w.starts_with("http://") || w.starts_with("https://")
                => state = EXP_END,

            (EXP_URL, w)
                if w.starts_with("http://") || w.starts_with("https://") || w.starts_with("../")
                => state = EXP_END,

            (_, _) => return false,
        }
    }

    state == EXP_END
}
/// True if LINE appears to be a line comment containing an URL,
/// possibly with a Markdown link label in front, and nothing else.
/// The Markdown link label, if present, may not contain whitespace.
/// Lines of this form are allowed to be overlength, because Markdown
/// offers no way to split a line in the middle of a URL, and the lengths
/// of URLs to external references are beyond our control.
True if LINE appears to be a line comment containing an URL,
possibly with a Markdown link label in front, and nothing else.
The Markdown link label, if present, may not contain whitespace.
Lines of this form are allowed to be overlength, because Markdown
offers no way to split a line in the middle of a URL, and the lengths
of URLs to external references are beyond our control.
True if LINE appears to be a line comment containing an URL possibly with a Markdown link label in front and nothing else . The Markdown link label if present may not contain whitespace . Lines of this form are allowed to be overlength because Markdown offers no way to split a line in the middle of a URL and the lengths of URLs to external references are beyond our control .
fn line_is_url(line: &str) -> bool {
    use self::LIUState::*;
    let mut state: LIUState = EXP_COMMENT_START;
    for tok in line.split_whitespace() {
        match (state, tok) {
            (EXP_COMMENT_START, "//") => state = EXP_LINK_LABEL_OR_URL,
            (EXP_COMMENT_START, "///") => state = EXP_LINK_LABEL_OR_URL,
            (EXP_COMMENT_START, "//!") => state = EXP_LINK_LABEL_OR_URL,
            (EXP_LINK_LABEL_OR_URL, w)
                if w.len() >= 4 && w.starts_with("[") && w.ends_with("]:")
                => state = EXP_URL,
            (EXP_LINK_LABEL_OR_URL, w)
                if w.starts_with("http://") || w.starts_with("https://")
                => state = EXP_END,
            (EXP_URL, w)
                if w.starts_with("http://") || w.starts_with("https://") || w.starts_with("../")
                => state = EXP_END,
            (_, _) => return false,
        }
    }
    state == EXP_END
}
fn line_is_url ( line : & str ) -> bool { use self :: LIUState :: * ; let mut state : LIUState = EXP_COMMENT_START ; for tok in line . split_whitespace ( ) { match ( state , tok ) { ( EXP_COMMENT_START , " " ) => state = EXP_LINK_LABEL_OR_URL , ( EXP_COMMENT_START , " " ) => state = EXP_LINK_LABEL_OR_URL , ( EXP_COMMENT_START , " " ) => state = EXP_LINK_LABEL_OR_URL , ( EXP_LINK_LABEL_OR_URL , w ) if w . len ( ) >= 4 && w . starts_with ( " " ) && w . ends_with ( " " ) => state = EXP_URL , ( EXP_LINK_LABEL_OR_URL , w ) if w . starts_with ( " " ) || w . starts_with ( " " ) => state = EXP_END , ( EXP_URL , w ) if w . starts_with ( " " ) || w . starts_with ( " " ) || w . starts_with ( " " ) => state = EXP_END , ( _ , _ ) => return false , } } state == EXP_END }
True if LINE appears to be a line comment containing an URL,
possibly with a Markdown link label in front, and nothing else.
True if LINE appears to be a line comment containing an URL possibly with a Markdown link label in front and nothing else .
line
&str