treewide: complete book management interface
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: If5a21f16221f3c56a8008e139f93edc46a6a6964
This commit is contained in:
parent
bda36ac152
commit
2f31242442
23 changed files with 1693 additions and 126 deletions
|
|
@ -98,7 +98,7 @@ impl PluginManifest {
|
|||
}
|
||||
|
||||
/// Parse a manifest from TOML string
|
||||
pub fn from_str(content: &str) -> Result<Self, ManifestError> {
|
||||
pub fn parse_str(content: &str) -> Result<Self, ManifestError> {
|
||||
let manifest: Self = toml::from_str(content)?;
|
||||
manifest.validate()?;
|
||||
Ok(manifest)
|
||||
|
|
@ -223,7 +223,7 @@ wasm = "plugin.wasm"
|
|||
read = ["/tmp/pinakes-thumbnails"]
|
||||
"#;
|
||||
|
||||
let manifest = PluginManifest::from_str(toml).unwrap();
|
||||
let manifest = PluginManifest::parse_str(toml).unwrap();
|
||||
assert_eq!(manifest.plugin.name, "heif-support");
|
||||
assert_eq!(manifest.plugin.version, "1.0.0");
|
||||
assert_eq!(manifest.plugin.kind.len(), 2);
|
||||
|
|
@ -242,7 +242,7 @@ kind = ["media_type"]
|
|||
wasm = "plugin.wasm"
|
||||
"#;
|
||||
|
||||
assert!(PluginManifest::from_str(toml).is_err());
|
||||
assert!(PluginManifest::parse_str(toml).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -258,6 +258,6 @@ kind = ["invalid_kind"]
|
|||
wasm = "plugin.wasm"
|
||||
"#;
|
||||
|
||||
assert!(PluginManifest::from_str(toml).is_err());
|
||||
assert!(PluginManifest::parse_str(toml).is_err());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue