style: formatting...
This commit is contained in:
parent
ba3e75c3fb
commit
d3469e7618
4 changed files with 13 additions and 13 deletions
|
@ -5,5 +5,5 @@ use serde::{Deserialize, Serialize};
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct Bin {
|
pub struct Bin {
|
||||||
pub root: String,
|
pub root: String,
|
||||||
pub checksums: HashMap<String, String>
|
pub checksums: HashMap<String, String>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,5 @@ use serde::{Deserialize, Serialize};
|
||||||
pub struct Build {
|
pub struct Build {
|
||||||
build_script: String,
|
build_script: String,
|
||||||
install_script: String,
|
install_script: String,
|
||||||
dependencies: HashMap<String, String>
|
dependencies: HashMap<String, String>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ use std::{collections::HashMap, str::FromStr};
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
pub mod package;
|
|
||||||
pub mod fs;
|
|
||||||
pub mod bin;
|
pub mod bin;
|
||||||
pub mod build;
|
pub mod build;
|
||||||
|
pub mod fs;
|
||||||
|
pub mod package;
|
||||||
pub mod pkgr;
|
pub mod pkgr;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
@ -16,13 +16,13 @@ pub struct Manifest<P = Option<pkgr::PKGR>> {
|
||||||
pub fs: fs::FS,
|
pub fs: fs::FS,
|
||||||
pub bin: Option<bin::Bin>,
|
pub bin: Option<bin::Bin>,
|
||||||
pub build: Option<build::Build>,
|
pub build: Option<build::Build>,
|
||||||
pub pkgr: P
|
pub pkgr: P,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Manifest<T> {
|
impl<T> Manifest<T> {
|
||||||
pub fn valid(&self) -> bool {
|
pub fn valid(&self) -> bool {
|
||||||
if self.bin.is_none() && self.build.is_none() {
|
if self.bin.is_none() && self.build.is_none() {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ impl Default for Manifest {
|
||||||
fs: fs::FS::default(),
|
fs: fs::FS::default(),
|
||||||
bin: None,
|
bin: None,
|
||||||
build: None,
|
build: None,
|
||||||
pkgr: None
|
pkgr: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ pub enum PackageType {
|
||||||
#[serde(rename = "library")]
|
#[serde(rename = "library")]
|
||||||
Library,
|
Library,
|
||||||
#[serde(rename = "meta")]
|
#[serde(rename = "meta")]
|
||||||
Meta
|
Meta,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
@ -20,7 +20,7 @@ pub struct Package {
|
||||||
pub package_type: PackageType,
|
pub package_type: PackageType,
|
||||||
pub version: u64,
|
pub version: u64,
|
||||||
pub tags: Vec<String>,
|
pub tags: Vec<String>,
|
||||||
pub arch: String
|
pub arch: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Package {
|
impl Default for Package {
|
||||||
|
@ -31,7 +31,7 @@ impl Default for Package {
|
||||||
package_type: PackageType::Application,
|
package_type: PackageType::Application,
|
||||||
version: 0,
|
version: 0,
|
||||||
tags: Vec::default(),
|
tags: Vec::default(),
|
||||||
arch: std::env::consts::ARCH.to_string()
|
arch: std::env::consts::ARCH.to_string(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,4 @@ impl FromStr for Package {
|
||||||
fn from_str(s: &str) -> Result<Package, toml::de::Error> {
|
fn from_str(s: &str) -> Result<Package, toml::de::Error> {
|
||||||
toml::from_str(s)
|
toml::from_str(s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue