1
0
mirror of https://github.com/Tim-Paik/neutauri.git synced 2024-10-12 23:29:41 +00:00
This commit is contained in:
2023-03-24 21:40:29 +08:00
parent 1bebb857ee
commit 167bee14e7
10 changed files with 483 additions and 469 deletions

View File

@ -4,14 +4,15 @@ name = "neutauri_data"
version = "0.1.0"
[dependencies]
anyhow = {version = "1.0", optional = true}
bincode = "1.3"
brotli = "3.3"
image = {version = "0.24", optional = true}
new_mime_guess = {version = "4.0", optional = true}
serde = {version = "1.0", features = ["derive"]}
toml = {version = "0.5", optional = true}
wry = {version = "0.23", default-features = false, features = ["protocol", "tray", "transparent", "fullscreen"]}
toml = {version = "0.7", optional = true}
wry = {version = "0.27", default-features = false, features = ["protocol", "tray", "transparent", "fullscreen"]}
[features]
bundler = ["new_mime_guess", "toml", "image"]
bundler = ["anyhow", "new_mime_guess", "toml", "image"]
runtime = []

View File

@ -307,7 +307,7 @@ impl Data {
Ok(target)
}
pub fn pack<P: AsRef<path::Path>>(config_path: P) -> Result<()> {
pub fn pack<P: AsRef<path::Path>>(config_path: P) -> anyhow::Result<()> {
let config_path = config_path.as_ref().canonicalize()?;
let config: Config = toml::from_str(fs::read_to_string(&config_path)?.as_str())?;
let source = match config_path.parent() {
@ -399,7 +399,7 @@ pub fn load<P: AsRef<path::Path> + Copy>(path: P) -> Result<Data> {
}
#[cfg(feature = "bundler")]
pub fn pack<P: AsRef<path::Path>>(config: P) -> Result<()> {
pub fn pack<P: AsRef<path::Path>>(config: P) -> anyhow::Result<()> {
Data::pack(config)
}