mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-12-23 11:25:54 +00:00
refactor: split sources from builder
This commit is contained in:
parent
73f1b52890
commit
791ceaa34e
1 changed files with 14 additions and 14 deletions
|
|
@ -36,15 +36,15 @@ impl LayerShika<NeedsComponent> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_file(
|
pub fn from_file(path: impl AsRef<Path>) -> Result<LayerShika<HasComponent>> {
|
||||||
|
Self::from_file_with_component(path, "Main")
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_file_with_component(
|
||||||
path: impl AsRef<Path>,
|
path: impl AsRef<Path>,
|
||||||
component_name: Option<&str>,
|
component_name: impl AsRef<str>,
|
||||||
) -> Result<LayerShika<HasComponent>> {
|
) -> Result<LayerShika<HasComponent>> {
|
||||||
Self::from_file_with_compiler(
|
Self::from_file_with_compiler(path, &mut Compiler::default(), component_name.as_ref())
|
||||||
path,
|
|
||||||
&mut Compiler::default(),
|
|
||||||
component_name.unwrap_or("Main"),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_file_with_compiler(
|
pub fn from_file_with_compiler(
|
||||||
|
|
@ -85,15 +85,15 @@ impl LayerShika<NeedsComponent> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_source(
|
pub fn from_source(source: impl AsRef<str>) -> Result<LayerShika<HasComponent>> {
|
||||||
|
Self::from_source_with_component(source, "Main")
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_source_with_component(
|
||||||
source: impl AsRef<str>,
|
source: impl AsRef<str>,
|
||||||
component_name: Option<&str>,
|
component_name: impl AsRef<str>,
|
||||||
) -> Result<LayerShika<HasComponent>> {
|
) -> Result<LayerShika<HasComponent>> {
|
||||||
Self::from_source_with_compiler(
|
Self::from_source_with_compiler(source, &mut Compiler::default(), component_name.as_ref())
|
||||||
source,
|
|
||||||
&mut Compiler::default(),
|
|
||||||
component_name.unwrap_or("Main"),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_source_with_compiler(
|
pub fn from_source_with_compiler(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue