Skip to content

Commit

Permalink
Merge branch 'main' into ci/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
pvshvp-oss committed Mar 18, 2024
2 parents a92a2fe + 01a2316 commit 810c269
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
1 change: 1 addition & 0 deletions paxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ toml = "0.8.10"
pollster = "0.3"
reqwest = "0.11"
url = { version = "2.3", features = ["serde"] }
extism = "1.2.0"
6 changes: 6 additions & 0 deletions paxy/src/actions/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ pub enum Error {

// region: IMPORTS

use std::path::Path;

use snafu::Snafu;

// endregion: IMPORTS

fn plugin(manifest: Box<Path>) -> Box<Path> {
todo!()
}
40 changes: 40 additions & 0 deletions paxy/src/data/manifest.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use std::{fs, path::Path};

use serde::{Deserialize, Serialize};
use url::Url;

#[derive(Debug, Serialize, Deserialize, PartialEq)]
struct Manifest {
version: Vec<Version>,
author: Option<String>,
name: String,
}

#[derive(Debug, Serialize, Deserialize, PartialEq)]
struct Version {
url: Url,
number: String,
}

fn parse_manifest(manifest: Box<Path>) -> Manifest {
let toml = fs::read_to_string(manifest).unwrap();
toml::from_str(&toml).unwrap()
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn parse_normal() {
let toml = r#"name = "paxy"
[[version]]
url = "https://github.com/tizonia/tizonia-openmax-il"
number = "1.0.0""#;
assert_eq!(toml::from_str::<Manifest>(toml).unwrap(), Manifest {
version: vec![Version {url: Url::parse("https://github.com/tizonia/tizonia-openmax-il").unwrap(), number: "1.0.0".to_string()}],
name: "paxy".to_string(),
author: None
});
}
}
2 changes: 2 additions & 0 deletions paxy/src/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ use snafu::Snafu;
// pub use some_module::*;

// endregion: RE-EXPORTS
mod config;
mod manifest;
6 changes: 3 additions & 3 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[toolchain]
channel = "nightly"
components = ["rustc", "cargo", "rust-std", "rustfmt"]
channel = "nightly-2024-03-17"
components = ["rustc", "cargo", "rust-std", "rustfmt", "clippy"]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
"x86_64-apple-darwin",
"aarch64-unknown-linux-gnu",
"aarch64-pc-windows-msvc",
"aarch64-apple-darwin",
]
]

0 comments on commit 810c269

Please sign in to comment.