Skip to content

Commit

Permalink
add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed May 9, 2024
1 parent 0b21062 commit 4f210ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,5 @@ jobs:
- name: Run tests
run: |
bash ./tools/setup_byond_linux.sh
$Env:RUST_BACKTRACE = 1
source $HOME/BYOND/byond/bin/byondsetup
cargo test --package byondapi-test --target i686-unknown-linux-gnu --test test -- test_byondapi_with_dreamdaemon --exact --nocapture
RUST_BACKTRACE=1 cargo test --package byondapi-test --target i686-unknown-linux-gnu --test test -- test_byondapi_with_dreamdaemon --exact --nocapture
4 changes: 3 additions & 1 deletion crates/byondapi-rs/src/value/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ use super::ByondValue;
use crate::{static_global::byond, Error};

impl ByondValue {
/// Try to get a length of a string in bytes, lists in number of assoc elements probably, will fail if it's neither a list or string
pub fn builtin_length(&self) -> Result<ByondValue, Error> {
let mut result = ByondValue::new();
unsafe {
map_byond_error!(byond().Byond_Length(&self.0, &mut result.0))?;
}
Ok(result)
}
/// Try to create a new byond object, equivalent to byond's new
pub fn builtin_new(
value_type: ByondValue,
arglist: &[ByondValue],
Expand All @@ -24,7 +26,7 @@ impl ByondValue {
}
Ok(result)
}

/// Try to create a new byond object, equivalent to byond's new, but takes a list as arguments instead
pub fn builtin_newarglist(
value_type: ByondValue,
arglist: ByondValue,
Expand Down

0 comments on commit 4f210ca

Please sign in to comment.