<commit_before>use crate::{build::BuildRoot,
            engine::Engine,
            error::Result,
            naming::Naming,
            util};
use failure::SyncFailure;
use habitat_common::ui::{Status,
                         UIWriter,
                         UI};
use habitat_core::package::PackageIdent;
use handlebars::Handlebars;
use std::{fs,
          path::{Path,
                 PathBuf},
          str::FromStr};

// This code makes heavy use of `#[cfg(unix)]` and `#[cfg(windows)]`. This should potentially be
// changed to use the various target feature flags.

/// The `Dockerfile` template.
#[cfg(unix)]
const DOCKERFILE: &str = include_str!("../defaults/Dockerfile.hbs");
#[cfg(windows)]
const DOCKERFILE: &str = include_str!("../defaults/Dockerfile_win.hbs");
/// The build report template.
const BUILD_REPORT: &str = include_str!("../defaults/last_container_export.env.hbs");

/// The file that the build report will be written to.
const BUILD_REPORT_FILE_NAME: &str = "last_container_export.env";

/// Provided only for backwards compatibility; will contain a
/// duplicate of the standard build report.
const OLD_BUILD_REPORT_FILE_NAME: &str = "last_docker_export.env";

/// A built container image which exists locally.
pub struct ContainerImage {
    /// The image ID for this image.
    id:      String,
    /// The name of this image.
    name:    String,
    /// The list of tags for this image.
    tags:    Vec<String>,
    /// The base workdir which hosts the root file system.
    workdir: PathBuf,

    /// All the identifiers for this image (in {name}:{tag} format)
    expanded_identifiers: Vec<String>,
}

impl ContainerImage {
    // TODO (CM): temporary; we shouldn't use this at all
    pub fn workdir(&self) -> &Path { self.workdir.as_path() }

    pub fn expanded_identifiers(&self) -> &Vec<String> { &self.expanded_identifiers }

    pub fn name(&self) -> String { self.name.clone() }

    pub fn tags(&self) -> Vec<String> { self.tags.clone() }
<commit_msg>[PR Feedback] Return &[String] instead of &Vec<String><commit_after>use crate::{build::BuildRoot,
            engine::Engine,
            error::Result,
            naming::Naming,
            util};
use failure::SyncFailure;
use habitat_common::ui::{Status,
                         UIWriter,
                         UI};
use habitat_core::package::PackageIdent;
use handlebars::Handlebars;
use std::{fs,
          path::{Path,
                 PathBuf},
          str::FromStr};

// This code makes heavy use of `#[cfg(unix)]` and `#[cfg(windows)]`. This should potentially be
// changed to use the various target feature flags.

/// The `Dockerfile` template.
#[cfg(unix)]
const DOCKERFILE: &str = include_str!("../defaults/Dockerfile.hbs");
#[cfg(windows)]
const DOCKERFILE: &str = include_str!("../defaults/Dockerfile_win.hbs");
/// The build report template.
const BUILD_REPORT: &str = include_str!("../defaults/last_container_export.env.hbs");

/// The file that the build report will be written to.
const BUILD_REPORT_FILE_NAME: &str = "last_container_export.env";

/// Provided only for backwards compatibility; will contain a
/// duplicate of the standard build report.
const OLD_BUILD_REPORT_FILE_NAME: &str = "last_docker_export.env";

/// A built container image which exists locally.
pub struct ContainerImage {
    /// The image ID for this image.
    id:      String,
    /// The name of this image.
    name:    String,
    /// The list of tags for this image.
    tags:    Vec<String>,
    /// The base workdir which hosts the root file system.
    workdir: PathBuf,

    /// All the identifiers for this image (in {name}:{tag} format)
    expanded_identifiers: Vec<String>,
}

impl ContainerImage {
    // TODO (CM): temporary; we shouldn't use this at all
    pub fn workdir(&self) -> &Path { self.workdir.as_path() }

    pub fn expanded_identifiers(&self) -> &[String] { &self.expanded_identifiers }

    pub fn name(&self) -> String { self.name.clone() }

    pub fn tags(&self) -> Vec<String> { self.tags.clone() }

{'fraction_non_alphanumeric': 0.13310242454230578, 'fraction_numerical': 0.0, 'mean_word_length': 2.9290573372206024, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6808477', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1199, 'n_words': 370}