Skip to content

Commit b1a04ed

Browse files
committed
aaaa
1 parent e3c4f81 commit b1a04ed

File tree

5 files changed

+8
-14
lines changed

5 files changed

+8
-14
lines changed

crates/byondapi-macros/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "byondapi-macros"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
description = "Macros for byondapi"
66
license = "MIT"
@@ -11,7 +11,6 @@ license = "MIT"
1111
proc-macro = true
1212

1313
[dependencies]
14-
inventory = "0.3.15"
1514
quote = "1.0"
1615
proc-macro2 = "1.0"
1716

crates/byondapi-macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub fn bind(attr: TokenStream, item: TokenStream) -> TokenStream {
136136
}
137137

138138
}
139-
fn #func_name(#args) -> Result<::byondapi::value::ByondValue, ::byondapi::Error>
139+
fn #func_name(#args) -> ::eyre::Result<::byondapi::value::ByondValue>
140140
#body
141141
};
142142
result.into()
@@ -237,7 +237,7 @@ pub fn bind_raw_args(attr: TokenStream, item: TokenStream) -> TokenStream {
237237
}
238238
}
239239
}
240-
fn #func_name(args: &mut [::byondapi::value::ByondValue]) -> Result<::byondapi::value::ByondValue, ::byondapi::Error>
240+
fn #func_name(args: &mut [::byondapi::value::ByondValue]) -> ::eyre::Result<::byondapi::value::ByondValue>
241241
#body
242242
};
243243
result.into()

crates/byondapi-rs-test/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ fn test_list_pop(mut list: ByondValue) {
9191
let element = list.pop_list()?;
9292

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

9997
Ok(element.unwrap())
@@ -115,10 +113,10 @@ fn test_block() {
115113
)?;
116114

117115
if block.len() != 4 {
118-
return Err(byondapi::Error::BindError(format!(
116+
return Err(eyre::eyre!(
119117
"block returned {} turfs when we expected 4",
120118
block.len()
121-
)));
119+
));
122120
}
123121

124122
Ok((block.len() as f32).into())

crates/byondapi-rs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "byondapi"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
authors = ["tigercat2000 <nick.pilant@gmail.com>"]
55
edition = "2021"
66
description = "Idiomatic Rust bindings for BYONDAPI"
@@ -14,7 +14,7 @@ exclude = [".vscode/*"]
1414

1515
[dependencies]
1616
byondapi-sys = { path = "../byondapi-sys", version = "0.11.1" }
17-
byondapi-macros = { path = "../byondapi-macros", version = "0.1.1" }
17+
byondapi-macros = { path = "../byondapi-macros", version = "0.1.2" }
1818
lazy_static = "1.4.0"
1919
libloading = "0.8.3"
2020
walkdir = "2.5.0"

crates/byondapi-rs/src/error.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ pub enum Error {
3232
NonExistentString(CString),
3333
/// Thrown when we know byondland failed to create a string
3434
UnableToCreateString(CString),
35-
/// Custom error type thrown by binds
36-
BindError(String),
3735
}
3836

3937
impl Error {
@@ -69,7 +67,6 @@ impl std::fmt::Display for Error {
6967
Self::UnableToCreateString(string) => {
7068
write!(f, "Unable to create string \"{string:#?}\"")
7169
}
72-
Self::BindError(string) => write!(f, "{string}"),
7370
}
7471
}
7572
}

0 commit comments

Comments
 (0)