(path: &str)
| 67 | |
| 68 | pub fn try_new(path: &str) -> Result<&Self, ResPathError> { |
| 69 | validate(path)?; |
| 70 | // SAFETY: validate rejects paths outside ResPath grammar. |
| 71 | Ok(unsafe { Self::new_unchecked_borrowed(path) }) |
| 72 | } |
| 73 | |
| 74 | pub fn intern(path: &str) -> Result<&'static Self, ResPathError> { |
| 75 | use std::sync::{OnceLock, RwLock}; |
| 76 | validate(path)?; |
| 77 | // Pool dedupes so repeated interns of the same path (e.g. a script |
nothing calls this directly
no test coverage detected