From fdaa289c2f55b31668ef0a6ec986cf459c834eb6 Mon Sep 17 00:00:00 2001 From: nic-gaffney Date: Thu, 27 Apr 2023 17:56:00 -0500 Subject: Applied changes requested by @CatDevz --- crates/sloth_vm/src/sloth_std/misc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/sloth_vm/src/sloth_std/misc.rs') diff --git a/crates/sloth_vm/src/sloth_std/misc.rs b/crates/sloth_vm/src/sloth_std/misc.rs index 54d6e37..4417e59 100644 --- a/crates/sloth_vm/src/sloth_std/misc.rs +++ b/crates/sloth_vm/src/sloth_std/misc.rs @@ -13,12 +13,12 @@ fn get_doc(vm: &mut VM, args: &[Primitive]) -> NativeFunctionResult { .get(ptr as usize) .ok_or(native::Error::InvalidArgument)?; - let ObjectType::String(str) = &object.typ else { + let ObjectType::NativeFunction(fnc) = &object.typ else { return Err(native::Error::InvalidArgument); }; let docs = NATIVE_LIBRARY - .get(str.as_str()) + .get(fnc.name.clone()) .ok_or(native::Error::InvalidArgument)? .doc .ok_or(native::Error::InvalidArgument)? @@ -30,8 +30,8 @@ fn get_doc(vm: &mut VM, args: &[Primitive]) -> NativeFunctionResult { Ok(Primitive::Object(ptr as u32)) } -pub const GET_DOC: NativeFunction = NativeFunction { - name: "get$doc", +pub const DOCS: NativeFunction = NativeFunction { + name: "docs", function: get_doc, arity: 1, returns_value: true, -- cgit v1.2.3