Skip to content

Commit

Permalink
Safer path ident names
Browse files Browse the repository at this point in the history
  • Loading branch information
aeplay committed Jul 1, 2019
1 parent a9fdc87 commit c5b928e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kay"
description = "Experimental high-performance actor system framework for Rust"
version = "0.4.4"
version = "0.4.5"
authors = ["Anselm Eickhoff <[email protected]>"]
repository = "https://github.com/aeickhoff/kay"
license = "MIT"
Expand Down
3 changes: 1 addition & 2 deletions src/class/instance_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ pub struct InstanceStore {
const CHUNK_SIZE: usize = 1024 * 1024 * 16;

impl InstanceStore {
pub fn new(type_name: &'static str, typical_size: usize, storage: Rc<dyn chunky::ChunkStorage>) -> InstanceStore {
let ident: chunky::Ident = type_name.into();
pub fn new(ident: &chunky::Ident, typical_size: usize, storage: Rc<dyn chunky::ChunkStorage>) -> InstanceStore {
InstanceStore {
instances: chunky::MultiArena::new(
ident.sub("instances"),
Expand Down
5 changes: 3 additions & 2 deletions src/class/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ pub enum MessageHandler {

impl Class {
pub fn new(v_table: ActorVTable, storage: Rc<dyn chunky::ChunkStorage>) -> Self {
let ident: chunky::Ident = v_table.type_name.replace("::", "-").replace("<", "(").replace(">", ")").into();
Class {
instance_store: InstanceStore::new(v_table.type_name, v_table.state_v_table.typical_size, Rc::clone(&storage)),
inbox: Inbox::new(&::chunky::Ident::from(v_table.type_name).sub("inbox"), storage),
instance_store: InstanceStore::new(&ident, v_table.state_v_table.typical_size, Rc::clone(&storage)),
inbox: Inbox::new(&ident.sub("inbox"), storage),
v_table,
}
}
Expand Down

0 comments on commit c5b928e

Please sign in to comment.