rename lol

This commit is contained in:
nora 2022-03-19 14:27:30 +01:00
parent c68cd04af7
commit 543e39f129
70 changed files with 283 additions and 266 deletions

View file

@ -28,7 +28,7 @@ pub fn main() -> anyhow::Result<()> {
"`yarn check-fmt` did not exist successfully"
);
let frontend = project_root().join("amqp_dashboard/frontend");
let frontend = project_root().join("haesli_dashboard/frontend");
yarn_install(&frontend)?;
println!("$ yarn check-fmt");
let status = Command::new("yarn")

View file

@ -127,13 +127,13 @@ pub fn main() -> anyhow::Result<()> {
.context("src directory path")?
.parent()
.context("xtask root path")?;
let amqp_spec = xtask_root.join("amqp0-9-1.xml");
let haesli_spec = xtask_root.join("amqp0-9-1.xml");
let project_root = xtask_root.parent().context("get project root parent")?;
let transport_generated_path = project_root.join("amqp_transport/src/methods/generated.rs");
let core_generated_path = project_root.join("amqp_core/src/methods/generated.rs");
let transport_generated_path = project_root.join("haesli_transport/src/methods/generated.rs");
let core_generated_path = project_root.join("haesli_core/src/methods/generated.rs");
let content = fs::read_to_string(amqp_spec).context("read amqp spec file")?;
let content = fs::read_to_string(haesli_spec).context("read amqp spec file")?;
let amqp = Amqp::from_str(&content).context("parse amqp spec file")?;
@ -202,7 +202,7 @@ impl Codegen {
self.output,
"pub type {} = {};\n",
domain.name.to_upper_camel_case(),
self.amqp_type_to_rust_type(&domain.kind),
self.haesli_type_to_rust_type(&domain.kind),
)
.ok();
}
@ -266,8 +266,8 @@ pub struct {class_name}{method_name}"
}
}
fn amqp_type_to_rust_type(&self, amqp_type: &str) -> &'static str {
match amqp_type {
fn haesli_type_to_rust_type(&self, haesli_type: &str) -> &'static str {
match haesli_type {
"octet" => "u8",
"short" => "u16",
"long" => "u32",
@ -277,7 +277,7 @@ pub struct {class_name}{method_name}"
"longstr" => "Vec<u8>",
"timestamp" => "u64",
"table" => "super::Table",
_ => unreachable!("invalid type {}", amqp_type),
_ => unreachable!("invalid type {}", haesli_type),
}
}

View file

@ -21,7 +21,7 @@ impl Codegen {
writeln!(
self.output,
"pub mod parse {{
use amqp_core::methods::*;
use haesli_core::methods::*;
use crate::error::TransError;
use crate::methods::parse_helper::*;
use nom::{{branch::alt, bytes::complete::tag}};

View file

@ -9,7 +9,7 @@ impl Codegen {
"
mod random {{
use rand::Rng;
use amqp_core::methods::*;
use haesli_core::methods::*;
use crate::methods::RandomMethod;
"
)

View file

@ -7,7 +7,7 @@ impl Codegen {
writeln!(
self.output,
"pub mod write {{
use amqp_core::methods::*;
use haesli_core::methods::*;
use crate::error::TransError;
use crate::methods::write_helper::*;
use std::io::Write;

View file

@ -21,7 +21,7 @@ pub fn main() -> anyhow::Result<()> {
.status()?;
ensure!(status.success(), "`yarn fmt` did not exist successfully");
let frontend = project_root().join("amqp_dashboard/frontend");
let frontend = project_root().join("haesli_dashboard/frontend");
yarn_install(&frontend)?;
println!("$ yarn fmt");
let status = Command::new("yarn")

View file

@ -15,7 +15,7 @@ pub fn main() -> Result<()> {
.context("cargo build")?;
ensure!(status.success(), "cargo build failed");
let mut amqp_server = Command::new("target/debug/amqp")
let mut haesli_server = Command::new("target/debug/amqp")
.env("RUST_LOG", "trace")
.spawn()
.context("target/debug/amqp run")?;
@ -25,7 +25,7 @@ pub fn main() -> Result<()> {
let test_result = run_js(&test_js_root);
amqp_server.kill().context("killing amqp server")?;
haesli_server.kill().context("killing amqp server")?;
test_result
}