(cargoToml: string)
| 151 | |
| 152 | /** A manifest's `[package]` name, wherever the section writes it (after a `categories = [...]` too). */ |
| 153 | export function parsePackageName(cargoToml: string): string | null { |
| 154 | const packageSection = getSection(cargoToml, 'package'); |
| 155 | if (!packageSection) return null; |
| 156 | const packageNameMatch = packageSection.match(/name\s*=\s*["']([^"'\n]+)["']/); |
| 157 | return packageNameMatch?.[1]?.trim() ?? null; |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * The target roots a manifest names with a `path` of their own: `[lib] path = |
no test coverage detected