Add #[cold] tags.

This commit is contained in:
Stephen Chung
2022-09-13 22:54:13 +08:00
parent 2458e05dcb
commit 396ec7df8a
8 changed files with 43 additions and 17 deletions

View File

@@ -9,7 +9,8 @@ use std::prelude::v1::*;
#[cfg(not(feature = "no_float"))]
use num_traits::Float;
#[inline]
#[cold]
#[inline(never)]
pub fn make_err(msg: impl Into<String>) -> RhaiError {
ERR::ErrorArithmetic(msg.into(), Position::NONE).into()
}

View File

@@ -120,11 +120,9 @@ pub trait Package {
///
/// def_package! {
/// /// My super-duper package.
/// pub MyPackage(module @ 10) {
/// pub MyPackage(module) {
/// // Load a native Rust function.
/// module.set_native_fn("my_add", add);
/// } |> |engine| {
/// engine.register_custom_operator("@", 160).unwrap();
/// }
/// }
/// ```