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: cache.rs
    path of file: ./repos/ferrous-actions/src/actions
    
    the code of the file until where you have to start completion: use crate::node;
use crate::node::path::Path;
use js_sys::JsString;
use std::collections::HashMap;
use std::convert::Into;
use wasm_bindgen::prelude::*;

const WORKSPACE_ENV_VAR: &str =
    
    fn build_patterns(&self) -> Vec<JsString> {
        let cwd = node::process::cwd();
        let mut result = Vec::with_capacity(self.paths.len());
        for path in &self.paths {
            // Rewrite path to be relative if we have a root
            let path = if let Some(relative_to) = &self.relative_to {
                let absolute = cwd.join(path);
                absolute.relative_to(relative_to)
            } else {
                path.clone()
            };
            let pattern = Self::path_to_glob(&path);
            result.push(pattern.into());
        }
        if self.relative_to.is_some() {
            // If we are going to specify paths relative to some path that we also
            // override GITHUB_WORKSPACE to, we add a comment so it will get
            // incorporated into the path hash.
            result.push(WORKSPACE_OVERRIDDEN_TAG.into());
        }
        result
    }