From 0830359f36366d4b45b0a62d36fd90460d4bd1d3 Mon Sep 17 00:00:00 2001 From: Bernard Kolobara Date: Wed, 9 Aug 2023 10:41:13 +0200 Subject: [PATCH] Fix lookup requiring known sizes at compile-time --- Cargo.toml | 2 +- src/ap/mod.rs | 2 +- src/function/process.rs | 2 +- src/process_name.rs | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7fef144..db36322 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lunatic" -version = "0.14.0" +version = "0.14.1" edition = "2021" authors = ["Bernard Kolobara "] description = "Helper library for building Rust applications that run on lunatic." diff --git a/src/ap/mod.rs b/src/ap/mod.rs index 2e0a9d3..1a9bb41 100644 --- a/src/ap/mod.rs +++ b/src/ap/mod.rs @@ -392,7 +392,7 @@ where /// Returns a process registered under `name` if it exists and the signature /// matches. - pub fn lookup(name: &N) -> Option { + pub fn lookup(name: &N) -> Option { let name = process_name::(ProcessType::ProcessRef, name.process_name()); let mut id = 0; let mut node_id = 0; diff --git a/src/function/process.rs b/src/function/process.rs index 089e782..e04ba8b 100644 --- a/src/function/process.rs +++ b/src/function/process.rs @@ -400,7 +400,7 @@ impl Process { } /// Look up a process. - pub fn lookup(name: &N) -> Option { + pub fn lookup(name: &N) -> Option { let name = process_name::(ProcessType::Process, name.process_name()); let mut id = 0; let mut node_id = 0; diff --git a/src/process_name.rs b/src/process_name.rs index bc24ccb..3456155 100644 --- a/src/process_name.rs +++ b/src/process_name.rs @@ -3,8 +3,8 @@ /// It is implemented for common string types such as `&str` and `String`, /// but can be implemented on a custom type to create a process name type. /// -/// It is best used with the [ProcessName](lunatic_macros::ProcessName) derive macro -/// to generate a unique name. +/// It is best used with the [ProcessName](lunatic_macros::ProcessName) derive +/// macro to generate a unique name. /// /// # Example /// @@ -28,7 +28,8 @@ /// } /// ``` /// -/// For more information, see the [derive macro](lunatic_macros::ProcessName) docs. +/// For more information, see the [derive macro](lunatic_macros::ProcessName) +/// docs. pub trait ProcessName { fn process_name(&self) -> &str; }