finish engram-lang: protocols, decorators, imports, Result, closures, stdlib, integration tests
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
//! version = "0.1.0"
|
||||
//! edition = "2026"
|
||||
//! "#;
|
||||
//! let manifest = Manifest::from_str(toml).unwrap();
|
||||
//! let manifest = Manifest::parse(toml).unwrap();
|
||||
//! assert_eq!(manifest.package.name, "my-service");
|
||||
//! ```
|
||||
|
||||
|
||||
@@ -342,14 +342,14 @@ pub struct Manifest {
|
||||
|
||||
impl Manifest {
|
||||
/// Parse a manifest from a TOML string.
|
||||
pub fn from_str(s: &str) -> crate::ManifestResult<Self> {
|
||||
pub fn parse(s: &str) -> crate::ManifestResult<Self> {
|
||||
crate::parse::parse_manifest(s)
|
||||
}
|
||||
|
||||
/// Parse a manifest from a file on disk.
|
||||
pub fn from_file(path: &std::path::Path) -> crate::ManifestResult<Self> {
|
||||
let text = std::fs::read_to_string(path).map_err(crate::ManifestError::Io)?;
|
||||
Self::from_str(&text)
|
||||
Self::parse(&text)
|
||||
}
|
||||
|
||||
/// Walk up the directory tree from `from` until an `el.toml` is found.
|
||||
|
||||
Reference in New Issue
Block a user