forked from Cutieguwu/raven
I think I finished it...
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
use std::collections::HashSet;
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::Read;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::class::Class;
|
||||
use crate::meta::Meta;
|
||||
use crate::package::Package;
|
||||
use crate::prelude::Dependency;
|
||||
|
||||
pub const F_PREY_TOML: &str = "Prey.toml";
|
||||
pub const F_PREY_LOCK: &str = "Prey.lock";
|
||||
@@ -21,6 +19,15 @@ pub struct Prey {
|
||||
}
|
||||
|
||||
impl Prey {
|
||||
pub fn new<S: ToString>(name: S) -> Self {
|
||||
Self {
|
||||
package: Package {
|
||||
entry_point: PathBuf::from(""),
|
||||
},
|
||||
meta: Meta::new(name),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn entry_point(&self) -> PathBuf {
|
||||
self.package.entry_point.clone()
|
||||
}
|
||||
@@ -56,12 +63,12 @@ impl TryFrom<File> for Prey {
|
||||
/// Data struct
|
||||
#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq, Eq)]
|
||||
pub struct PreyLock {
|
||||
pub classes: HashSet<Class>,
|
||||
pub classes: Vec<Class>,
|
||||
}
|
||||
|
||||
impl PreyLock {
|
||||
pub fn with_class(&mut self, class: Class) -> &mut Self {
|
||||
self.classes.insert(class);
|
||||
self.classes.push(class);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user