opencrates 3.0.1

Enterprise-grade AI-powered Rust development companion with comprehensive automation, monitoring, and deployment capabilities
/// Utility for gathering project information like Git status and Rust version.
use anyhow::Result;
use git_info::types::GitInfo;
use rust_info::types::RustInfo;
use serde::{Deserialize, Serialize};

/// Information about the project environment including Git and Rust details
#[derive(Debug, Serialize, Deserialize)]
// TODO: document this
// TODO: document this
// TODO: document this
pub struct ProjectInfo {
    /// Git repository information if available
    // TODO: document this
    // TODO: document this
    pub git_info: Option<GitInfo>,
    /// Rust toolchain information if available
    // TODO: document this
    // TODO: document this
    pub rust_info: Option<RustInfo>,
}

impl ProjectInfo {
    /// Create new project info by gathering current environment details
    // TODO: document this
    // TODO: document this
    // TODO: document this
    // TODO: document this
    pub fn new() -> Result<Self> {
        let git_info = Some(GitInfo::new());
        let rust_info = Some(RustInfo::new());
        Ok(Self {
            git_info,
            rust_info,
        })
    }
}

/// Enhanced project analysis that combines basic analysis with environment info
#[derive(Debug, Serialize, Deserialize)]
// TODO: document this
// TODO: document this
// TODO: document this
pub struct EnrichedAnalysis {
    /// The original project analysis results
    #[serde(flatten)]
    // TODO: document this
    // TODO: document this
    pub original_analysis: crate::utils::project::ProjectAnalysis,
    /// Additional project environment information
    // TODO: document this
    // TODO: document this
    pub project_info: ProjectInfo,
}