aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/licenses.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-05 17:29:12 +0900
committernsfisis <nsfisis@gmail.com>2026-05-05 17:29:12 +0900
commit49b0884701a84731652fc934d428932ff6029bd4 (patch)
tree7477029b8ed686b9b3b06d960cab2b54ba87b579 /crates/mozart/src/commands/licenses.rs
parent4623874d1c95414dcd5ae194d2561f2d98b40982 (diff)
downloadphp-mozart-49b0884701a84731652fc934d428932ff6029bd4.tar.gz
php-mozart-49b0884701a84731652fc934d428932ff6029bd4.tar.zst
php-mozart-49b0884701a84731652fc934d428932ff6029bd4.zip
chore: remove redundant comments
Diffstat (limited to 'crates/mozart/src/commands/licenses.rs')
-rw-r--r--crates/mozart/src/commands/licenses.rs22
1 files changed, 0 insertions, 22 deletions
diff --git a/crates/mozart/src/commands/licenses.rs b/crates/mozart/src/commands/licenses.rs
index 595cf43..5c131b4 100644
--- a/crates/mozart/src/commands/licenses.rs
+++ b/crates/mozart/src/commands/licenses.rs
@@ -19,16 +19,12 @@ pub struct LicensesArgs {
pub locked: bool,
}
-// ─── Data structures ────────────────────────────────────────────────────────
-
struct LicenseEntry {
name: String,
version: String,
licenses: Vec<String>,
}
-// ─── Main entry point ───────────────────────────────────────────────────────
-
pub async fn execute(
args: &LicensesArgs,
cli: &super::Cli,
@@ -93,8 +89,6 @@ pub async fn execute(
Ok(())
}
-// ─── Package loading ─────────────────────────────────────────────────────────
-
fn load_installed_licenses(working_dir: &Path, no_dev: bool) -> anyhow::Result<Vec<LicenseEntry>> {
let vendor_dir = working_dir.join("vendor");
let installed = mozart_registry::installed::InstalledPackages::read(&vendor_dir)?;
@@ -155,8 +149,6 @@ fn load_locked_licenses(working_dir: &Path, no_dev: bool) -> anyhow::Result<Vec<
Ok(entries)
}
-// ─── License extraction ───────────────────────────────────────────────────────
-
fn extract_installed_licenses(
pkg: &mozart_registry::installed::InstalledPackageEntry,
) -> Vec<String> {
@@ -172,8 +164,6 @@ fn extract_installed_licenses(
.unwrap_or_default()
}
-// ─── License counting ─────────────────────────────────────────────────────────
-
fn count_licenses(entries: &[LicenseEntry]) -> Vec<(String, usize)> {
let mut counts: std::collections::BTreeMap<String, usize> = std::collections::BTreeMap::new();
@@ -193,8 +183,6 @@ fn count_licenses(entries: &[LicenseEntry]) -> Vec<(String, usize)> {
result
}
-// ─── Rendering ───────────────────────────────────────────────────────────────
-
fn render_text(
root_name: &str,
root_version: &str,
@@ -378,8 +366,6 @@ fn render_summary(entries: &[LicenseEntry], console: &Console) {
);
}
-// ─── Tests ───────────────────────────────────────────────────────────────────
-
#[cfg(test)]
mod tests {
use super::*;
@@ -404,8 +390,6 @@ mod tests {
}
}
- // ── extract_installed_licenses ────────────────────────────────────────────
-
#[test]
fn test_extract_installed_licenses_present() {
let mut extra = BTreeMap::new();
@@ -440,8 +424,6 @@ mod tests {
assert!(extract_installed_licenses(&pkg).is_empty());
}
- // ── count_licenses ────────────────────────────────────────────────────────
-
#[test]
fn test_count_licenses() {
let entries = vec![
@@ -488,8 +470,6 @@ mod tests {
assert_eq!(counts[0], ("none".to_string(), 1));
}
- // ── Integration tests ─────────────────────────────────────────────────────
-
#[test]
fn test_load_installed_licenses_basic() {
use tempfile::tempdir;
@@ -685,8 +665,6 @@ mod tests {
assert_eq!(entries_all.len(), 2);
}
- // ── Root license parsing ──────────────────────────────────────────────────
-
#[test]
fn test_root_license_array_in_json() {
use tempfile::tempdir;