MCPcopy Create free account
hub / github.com/PerroEngine/Perro / project_main_scene

Function project_main_scene

perro_editor/res/scripts/app/editor_manager.rs:1–19  ·  view source on GitHub ↗
(text: &str)

Source from the content-addressed store, hash-verified

1pub fn project_main_scene(text: &str) -> Option<String> {
2 let mut in_project = false;
3 for line in text.lines() {
4 let trimmed = line.trim();
5 if trimmed == "[project]" {
6 in_project = true;
7 continue;
8 }
9 if in_project && trimmed.starts_with('[') {
10 return None;
11 }
12 if in_project && trimmed.starts_with("main_scene") {
13 let (_, value) = trimmed.split_once('=')?;
14 let value = value.trim().trim_matches('"').to_string();
15 return (!value.is_empty()).then_some(value);
16 }
17 }
18 None
19}

Callers 1

open_projectFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected