MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / load

Method load

src/build.rs:198–215  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

196 }
197
198 pub fn path(name: impl Into<String>, path: impl Into<PathBuf>) -> Self {
199 Self::Path {
200 name: name.into(),
201 path: path.into(),
202 }
203 }
204
205 fn load(&self) -> Result<LoadedSource, BuildError> {
206 match self {
207 Self::Inline {
208 name,
209 source,
210 source_path,
211 } => Ok(LoadedSource {
212 name: name.clone(),
213 source: source.clone(),
214 source_path: source_path.clone(),
215 }),
216 Self::Path { name, path } => Ok(LoadedSource {
217 name: name.clone(),
218 source: fs::read_to_string(path).map_err(BuildError::Io)?,

Callers 1

buildMethod · 0.45

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected