You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: util.rs
    path of file: ./repos/rls/racer/src/racer
    
    the code of the file until where you have to start completion: // Small functions of utility
use std::rc::Rc;
use std::{cmp, error, fmt, path};
use std::{
    collections::hash_map::DefaultHasher,
    hash::{Hash, Hasher},
};

use crate::core::SearchType::{self, ExactMatch, StartsWith};
use crate::core::{BytePos, ByteRange, Location, LocationExt, RawSource, Session, SessionExt};

#[cfg(unix)]
pub const PATH_SEP: char = ':';
#[cfg(windows)]
pub const PATH_SEP: char = ';';

#[inline]
pub(crate) fn is_pattern_char(c: char) -> bool {
    c.is_alphanumeric() || c.is_whitespace() || (c == '_') || (c == ':') || (c == '.')
}

#[inline]
pub(crate
    
pub fn txt_matches_with_pos(stype: SearchType, needle: &str, haystack: &str) -> Option<usize> {
    if needle.is_empty() {
        return Some(0);
    }
    match stype {
        ExactMatch => {
            let n_len = needle.len();
            let h_len = haystack.len();
            for (n, _) in haystack.match_indices(needle) {
                if (n == 0 || !is_ident_char(char_before(haystack, n)))
                    && (n + n_len == h_len || !is_ident_char(char_at(haystack, n + n_len)))
                {
                    return Some(n);
                }
            }
        }
        StartsWith => {
            for (n, _) in haystack.match_indices(needle) {
                if n == 0 || !is_ident_char(char_before(haystack, n)) {
                    return Some(n);
                }
            }
        }
    }
    None
}