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: stratis_clevis_setup_generator.rs
    path of file: ./repos/stratisd/src/bin/utils/generators
    
    the code of the file until where you have to start completion: // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use std::{error::Error, path::PathBuf};

use log::{error, warn};
use uuid::Uuid;

use super
    
fn generator_with_err(early_dir: String) -> Result<(), Box<dyn Error>> {
    let kernel_cmdline = lib::get_kernel_cmdline()?;

    let pool_uuid_key = "stratis.rootfs.pool_uuid";
    let pool_uuid = match kernel_cmdline
        .get(pool_uuid_key)
        .and_then(|opt_vec| opt_vec.as_ref())
        .and_then(|vec| vec.iter().next())
    {
        Some(uuid) => uuid,
        None => {
            warn!("{pool_uuid_key} kernel command line parameter not found; disabling generator");
            return Ok(());
        }
    };

    let parsed_pool_uuid = Uuid::parse_str(pool_uuid)?;
    let file_contents = unit_template(parsed_pool_uuid);
    let mut path = PathBuf::from(early_dir);
    path.push("stratis-clevis-setup.service");
    lib::write_unit_file(&path, file_contents)?;

    Ok(())
}