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: write.rs
    path of file: ./repos/rustsec/platforms/platforms-data-gen/src
    
    the code of the file until where you have to start completion: //! Generates and writes contents of the auto-generated files

use std::io::Result;
use std::io::Write;

use crate::comments::Comments;
use crate::doc_target_info::DocTargetInfo;
use crate::doc_target_info::DocTargetsInfo;
use crate::enums::*;
use crate::rustc_target_info::{RustcTargetInfo, RustcTargetsInfo};
use crate::templates::Templates;

pub(crate) const FIELDS_WITH_ENUMS: [&'static str; 5] = [
   
    
    fn from_str(name: &str) -> Result<Self, Self::Err> {{
        let result = match name {{"
    )?;
    for raw_string in &raw_strings {
        let variant = enumify_value(key, &raw_string);
        //                            "android" => OS::Android,
        writeln!(out, "            \"{raw_string}\" => {variant},")?;
    }
    writeln!(
        out,
        "            _ => return Err(Error),
        }};

        Ok(result)
    }}