INNER CODE UNIT · Rust

save

vmware-labs/wasm-workers-server · crates/config/src/lib.rs:113

    pub fn save(&self, project_root: &Path) -> Result<()> {
        Ok(fs::write(
            Self::config_path(project_root),
            toml::to_string_pretty(self)?,
        )?)
    }

    /// Retrieve the configuration path from the project root
    fn config_path(project_root: &Path) -> PathBuf {
        project_root.join(CONFIG_FILENAME)
    }

    /// Provides a list of all file extensions handled by the runtimes
    /// that are currently installed in `project_root`
    pub fn get_runtime_extensions(&self, project_root: &Path) -> Vec<String> {
        let mut extensions: Vec<String> = vec![String::from("js"), String::from("wasm")];

        for repo in &self.repositories {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…