MCPcopy Create free account
hub / github.com/KingOfBugbounty/enumrust / count_lines

Function count_lines

src/main.rs:3296–3304  ·  view source on GitHub ↗

Count lines in a file

(path: &Path)

Source from the content-addressed store, hash-verified

3294
3295/// Count lines in a file
3296fn count_lines(path: &Path) -> Result<usize> {
3297 if !path.exists() {
3298 return Ok(0);
3299 }
3300
3301 let raw = fs::read(path)?;
3302 let content = String::from_utf8_lossy(&raw);
3303 Ok(content.lines().filter(|line| !line.trim().is_empty()).count())
3304}
3305
3306/// Parse JSON outputs in object-per-line or full JSON formats and return JSON objects.
3307fn parse_json_objects_from_content(content: &str) -> Vec<serde_json::Value> {

Callers 1

process_domain_implFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected