Skip to content

Commit

Permalink
feat: Add clone to Variant and plugin functions
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Mar 17, 2024
1 parent 7ad52bd commit 5d26982
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 141 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "re_set-lib"
version = "2.0.0"
version = "2.1.0"
edition = "2021"
description = "Data structure library for ReSet"
repository = "https://github.com/Xetibo/ReSet-Lib"
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(trait_upcasting)]
#![feature(unsized_fn_params)]
use directories_next as dirs;
use std::{fmt, fs, path::PathBuf};

Expand Down
24 changes: 21 additions & 3 deletions src/utils/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
use std::collections::HashMap;

use super::variant::TVariant;
use super::variant::Variant;

pub fn plugin_data() -> HashMap<String, Box<dyn TVariant>> {
HashMap::new()
pub fn plugin_data() -> PluginData {
PluginData(HashMap::new())
}

#[repr(C)]
pub struct PluginCapabilities(Vec<String>);

impl PluginCapabilities {
pub fn get_capabilities(&self) -> Vec<String> {
self.0.clone()
}
}

#[repr(C)]
pub struct PluginData(HashMap<String, Variant>);

impl PluginData {
pub fn get_data(&self) -> HashMap<String, Variant> {
self.0.clone()
}
}
Loading

0 comments on commit 5d26982

Please sign in to comment.