Skip to content

Commit

Permalink
aaaa
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed Mar 7, 2024
1 parent e3c4f81 commit b1a04ed
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
3 changes: 1 addition & 2 deletions crates/byondapi-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "byondapi-macros"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
description = "Macros for byondapi"
license = "MIT"
Expand All @@ -11,7 +11,6 @@ license = "MIT"
proc-macro = true

[dependencies]
inventory = "0.3.15"
quote = "1.0"
proc-macro2 = "1.0"

Expand Down
4 changes: 2 additions & 2 deletions crates/byondapi-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub fn bind(attr: TokenStream, item: TokenStream) -> TokenStream {
}

}
fn #func_name(#args) -> Result<::byondapi::value::ByondValue, ::byondapi::Error>
fn #func_name(#args) -> ::eyre::Result<::byondapi::value::ByondValue>
#body
};
result.into()
Expand Down Expand Up @@ -237,7 +237,7 @@ pub fn bind_raw_args(attr: TokenStream, item: TokenStream) -> TokenStream {
}
}
}
fn #func_name(args: &mut [::byondapi::value::ByondValue]) -> Result<::byondapi::value::ByondValue, ::byondapi::Error>
fn #func_name(args: &mut [::byondapi::value::ByondValue]) -> ::eyre::Result<::byondapi::value::ByondValue>
#body
};
result.into()
Expand Down
8 changes: 3 additions & 5 deletions crates/byondapi-rs-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ fn test_list_pop(mut list: ByondValue) {
let element = list.pop_list()?;

if list.builtin_length()?.get_number()? as u32 != 4 {
return Err(byondapi::Error::BindError(format!(
"pop did not actually remove item from list"
)));
return Err(eyre::eyre!("pop did not actually remove item from list"));
}

Ok(element.unwrap())
Expand All @@ -115,10 +113,10 @@ fn test_block() {
)?;

if block.len() != 4 {
return Err(byondapi::Error::BindError(format!(
return Err(eyre::eyre!(
"block returned {} turfs when we expected 4",
block.len()
)));
));
}

Ok((block.len() as f32).into())
Expand Down
4 changes: 2 additions & 2 deletions crates/byondapi-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "byondapi"
version = "0.4.1"
version = "0.4.2"
authors = ["tigercat2000 <[email protected]>"]
edition = "2021"
description = "Idiomatic Rust bindings for BYONDAPI"
Expand All @@ -14,7 +14,7 @@ exclude = [".vscode/*"]

[dependencies]
byondapi-sys = { path = "../byondapi-sys", version = "0.11.1" }
byondapi-macros = { path = "../byondapi-macros", version = "0.1.1" }
byondapi-macros = { path = "../byondapi-macros", version = "0.1.2" }
lazy_static = "1.4.0"
libloading = "0.8.3"
walkdir = "2.5.0"
Expand Down
3 changes: 0 additions & 3 deletions crates/byondapi-rs/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ pub enum Error {
NonExistentString(CString),
/// Thrown when we know byondland failed to create a string
UnableToCreateString(CString),
/// Custom error type thrown by binds
BindError(String),
}

impl Error {
Expand Down Expand Up @@ -69,7 +67,6 @@ impl std::fmt::Display for Error {
Self::UnableToCreateString(string) => {
write!(f, "Unable to create string \"{string:#?}\"")
}
Self::BindError(string) => write!(f, "{string}"),
}
}
}
Expand Down

0 comments on commit b1a04ed

Please sign in to comment.