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: utils.rs
    path of file: ./repos/spyglass/crates/spyglass-plugin/src
    
    the code of the file until where you have to start completion: use std::path::PathBuf;
use url::Url;

// Create a file URI
pub fn path_to_uri(path: PathBuf) -> String {
    let path_str = path.display().to_string();
    path_string_to_uri(&path_str)
}

/// Helper method that can be used to generate a document url from a file path string
pub fn path_string_to_uri(path_str: &str) -> String {
    // Eventually this will be away 
    
    fn test_path_to_uri() {
        #[cfg(target_os = "windows")]
        let test_folder = Path::new("C:\\tmp\\path_to_uri");

        #[cfg(not(target_os = "windows"))]
        let test_folder = Path::new("/tmp/path_to_uri");

        std::fs::create_dir_all(test_folder).expect("Unable to create test dir");

        let test_path = test_folder.join("test.txt");
        let uri = path_to_uri(test_path.to_path_buf());

        #[cfg(target_os = "windows")]
        assert_eq!(uri, "file:///C%3A/tmp/path_to_uri/test.txt");
        #[cfg(not(target_os = "windows"))]
        assert_eq!(uri, "file:///tmp/path_to_uri/test.txt");

        let url = Url::parse(&uri).unwrap();
        let file_path = url.to_file_path().unwrap();
        assert_eq!(file_path, test_path);

        if test_folder.exists() {
            std::fs::remove_dir_all(test_folder).expect("Unable to clean up test folder");
        }
    }