diff --git a/heromodels/Cargo.toml b/heromodels/Cargo.toml index 878bcdd..ca2535f 100644 --- a/heromodels/Cargo.toml +++ b/heromodels/Cargo.toml @@ -53,10 +53,10 @@ path = "examples/finance_example/main.rs" name = "flow_example" path = "examples/flow_example.rs" -[[example]] -name = "biz_rhai" -path = "examples/biz_rhai/example.rs" -required-features = ["rhai"] +# [[example]] +# name = "biz_rhai" +# path = "examples/biz_rhai/example.rs" +# required-features = ["rhai"] [[example]] name = "postgres_model_example" diff --git a/heromodels/examples/circle_launcher_example.rs b/heromodels/examples/circle_launcher_example.rs index 13a88dc..d523ecc 100644 --- a/heromodels/examples/circle_launcher_example.rs +++ b/heromodels/examples/circle_launcher_example.rs @@ -1,26 +1,26 @@ -use circles_launcher::{new_launcher}; -use heromodels::models::circle::circle::{new_circle}; -use secp256k1::{Secp256k1, SecretKey, PublicKey}; +use circles_launcher::new_launcher; +use heromodels::models::circle::circle::new_circle; use rand::rngs::OsRng; +use secp256k1::{PublicKey, Secp256k1, SecretKey}; #[tokio::main] -async fn main() -> Result<(), Box> { +async fn main() -> Result<(), Box> { // Generate valid secp256k1 keypairs for testing let secp = Secp256k1::new(); let mut rng = OsRng; - + let secret_key1 = SecretKey::new(&mut rng); let public_key1 = PublicKey::from_secret_key(&secp, &secret_key1); let pk1_hex = hex::encode(public_key1.serialize()); - + let secret_key2 = SecretKey::new(&mut rng); let public_key2 = PublicKey::from_secret_key(&secp, &secret_key2); let pk2_hex = hex::encode(public_key2.serialize()); - + let secret_key3 = SecretKey::new(&mut rng); let public_key3 = PublicKey::from_secret_key(&secp, &secret_key3); let pk3_hex = hex::encode(public_key3.serialize()); - + println!("Generated test public keys:"); println!(" PK1: {}", pk1_hex); println!(" PK2: {}", pk2_hex); @@ -36,4 +36,4 @@ async fn main() -> Result<(), Box> { .save(); Ok(()) -} \ No newline at end of file +} diff --git a/heromodels/examples/heroledger/main.rs b/heromodels/examples/heroledger/main.rs index 0c28941..feea33f 100644 --- a/heromodels/examples/heroledger/main.rs +++ b/heromodels/examples/heroledger/main.rs @@ -1,6 +1,6 @@ +use heromodels::models::heroledger::rhai::register_heroledger_rhai_modules; use heromodels_core::db::hero::OurDB; use rhai::{Dynamic, Engine}; -use heromodels::models::heroledger::rhai::register_heroledger_rhai_modules; use std::sync::Arc; use std::{fs, path::Path}; diff --git a/heromodels/examples/postgres_example/example.rs b/heromodels/examples/postgres_example/example.rs index 3cc1eb4..bc8e775 100644 --- a/heromodels/examples/postgres_example/example.rs +++ b/heromodels/examples/postgres_example/example.rs @@ -43,8 +43,10 @@ fn main() { // Clean up any existing data to ensure consistent results println!("Cleaning up existing data..."); let user_collection = db.collection::().expect("can open user collection"); - let comment_collection = db.collection::().expect("can open comment collection"); - + let comment_collection = db + .collection::() + .expect("can open comment collection"); + // Clear all existing users and comments if let Ok(existing_users) = user_collection.get_all() { for user in existing_users { diff --git a/heromodels/src/db/hero.rs b/heromodels/src/db/hero.rs index 1bff959..61beb2f 100644 --- a/heromodels/src/db/hero.rs +++ b/heromodels/src/db/hero.rs @@ -8,8 +8,8 @@ use std::{ collections::HashSet, path::PathBuf, sync::{ - atomic::{AtomicU32, Ordering}, Arc, Mutex, + atomic::{AtomicU32, Ordering}, }, }; diff --git a/heromodels/src/models/circle/circle.rs b/heromodels/src/models/circle/circle.rs index 11bbeec..f767751 100644 --- a/heromodels/src/models/circle/circle.rs +++ b/heromodels/src/models/circle/circle.rs @@ -119,4 +119,4 @@ impl Circle { /// Creates a new circle builder pub fn new_circle() -> Circle { Circle::new() -} \ No newline at end of file +} diff --git a/heromodels/src/models/circle/rhai.rs b/heromodels/src/models/circle/rhai.rs index d8c37cd..da673b9 100644 --- a/heromodels/src/models/circle/rhai.rs +++ b/heromodels/src/models/circle/rhai.rs @@ -1,16 +1,17 @@ use crate::db::Db; -use rhailib_macros::{ - register_authorized_create_by_id_fn, register_authorized_delete_by_id_fn, register_authorized_get_by_id_fn, -}; use rhai::plugin::*; use rhai::{Array, Dynamic, Engine, EvalAltResult, Map, Module}; +use rhailib_macros::{ + register_authorized_create_by_id_fn, register_authorized_delete_by_id_fn, + register_authorized_get_by_id_fn, +}; use std::collections::HashMap; use std::sync::Arc; use crate::models::circle::Circle; type RhaiCircle = Circle; -use crate::db::hero::OurDB; use crate::db::Collection; +use crate::db::hero::OurDB; use crate::models::circle::ThemeData; #[export_module] diff --git a/heromodels/src/models/grid4/mod.rs b/heromodels/src/models/grid4/mod.rs index 657c12c..166669e 100644 --- a/heromodels/src/models/grid4/mod.rs +++ b/heromodels/src/models/grid4/mod.rs @@ -1,16 +1,6 @@ pub mod node; pub use node::{ - Node, - DeviceInfo, - StorageDevice, - MemoryDevice, - CPUDevice, - GPUDevice, - NetworkDevice, - NodeCapacity, - ComputeSlice, - StorageSlice, - PricingPolicy, - SLAPolicy, -}; \ No newline at end of file + CPUDevice, ComputeSlice, DeviceInfo, GPUDevice, MemoryDevice, NetworkDevice, Node, + NodeCapacity, PricingPolicy, SLAPolicy, StorageDevice, StorageSlice, +}; diff --git a/heromodels/src/models/grid4/node.rs b/heromodels/src/models/grid4/node.rs index 9af4cb8..8213959 100644 --- a/heromodels/src/models/grid4/node.rs +++ b/heromodels/src/models/grid4/node.rs @@ -1,6 +1,6 @@ use heromodels_core::BaseModelData; use heromodels_derive::model; -use rhai::CustomType; +use rhai::{CustomType, TypeBuilder}; use serde::{Deserialize, Serialize}; /// Storage device information @@ -160,19 +160,58 @@ impl ComputeSlice { } } - pub fn nodeid(mut self, nodeid: u32) -> Self { self.nodeid = nodeid; self } - pub fn slice_id(mut self, id: i32) -> Self { self.id = id; self } - pub fn mem_gb(mut self, v: f64) -> Self { self.mem_gb = v; self } - pub fn storage_gb(mut self, v: f64) -> Self { self.storage_gb = v; self } - pub fn passmark(mut self, v: i32) -> Self { self.passmark = v; self } - pub fn vcores(mut self, v: i32) -> Self { self.vcores = v; self } - pub fn cpu_oversubscription(mut self, v: i32) -> Self { self.cpu_oversubscription = v; self } - pub fn storage_oversubscription(mut self, v: i32) -> Self { self.storage_oversubscription = v; self } - pub fn price_range(mut self, min_max: Vec) -> Self { self.price_range = min_max; self } - pub fn gpus(mut self, v: u8) -> Self { self.gpus = v; self } - pub fn price_cc(mut self, v: f64) -> Self { self.price_cc = v; self } - pub fn pricing_policy(mut self, p: PricingPolicy) -> Self { self.pricing_policy = p; self } - pub fn sla_policy(mut self, p: SLAPolicy) -> Self { self.sla_policy = p; self } + pub fn nodeid(mut self, nodeid: u32) -> Self { + self.nodeid = nodeid; + self + } + pub fn slice_id(mut self, id: i32) -> Self { + self.id = id; + self + } + pub fn mem_gb(mut self, v: f64) -> Self { + self.mem_gb = v; + self + } + pub fn storage_gb(mut self, v: f64) -> Self { + self.storage_gb = v; + self + } + pub fn passmark(mut self, v: i32) -> Self { + self.passmark = v; + self + } + pub fn vcores(mut self, v: i32) -> Self { + self.vcores = v; + self + } + pub fn cpu_oversubscription(mut self, v: i32) -> Self { + self.cpu_oversubscription = v; + self + } + pub fn storage_oversubscription(mut self, v: i32) -> Self { + self.storage_oversubscription = v; + self + } + pub fn price_range(mut self, min_max: Vec) -> Self { + self.price_range = min_max; + self + } + pub fn gpus(mut self, v: u8) -> Self { + self.gpus = v; + self + } + pub fn price_cc(mut self, v: f64) -> Self { + self.price_cc = v; + self + } + pub fn pricing_policy(mut self, p: PricingPolicy) -> Self { + self.pricing_policy = p; + self + } + pub fn sla_policy(mut self, p: SLAPolicy) -> Self { + self.sla_policy = p; + self + } } /// Storage slice (typically 1GB of storage) @@ -204,11 +243,26 @@ impl StorageSlice { } } - pub fn nodeid(mut self, nodeid: u32) -> Self { self.nodeid = nodeid; self } - pub fn slice_id(mut self, id: i32) -> Self { self.id = id; self } - pub fn price_cc(mut self, v: f64) -> Self { self.price_cc = v; self } - pub fn pricing_policy(mut self, p: PricingPolicy) -> Self { self.pricing_policy = p; self } - pub fn sla_policy(mut self, p: SLAPolicy) -> Self { self.sla_policy = p; self } + pub fn nodeid(mut self, nodeid: u32) -> Self { + self.nodeid = nodeid; + self + } + pub fn slice_id(mut self, id: i32) -> Self { + self.id = id; + self + } + pub fn price_cc(mut self, v: f64) -> Self { + self.price_cc = v; + self + } + pub fn pricing_policy(mut self, p: PricingPolicy) -> Self { + self.pricing_policy = p; + self + } + pub fn sla_policy(mut self, p: SLAPolicy) -> Self { + self.sla_policy = p; + self + } } /// Grid4 Node model @@ -248,17 +302,41 @@ impl Node { } } - pub fn nodegroupid(mut self, v: i32) -> Self { self.nodegroupid = v; self } - pub fn uptime(mut self, v: i32) -> Self { self.uptime = v; self } - pub fn add_compute_slice(mut self, s: ComputeSlice) -> Self { self.computeslices.push(s); self } - pub fn add_storage_slice(mut self, s: StorageSlice) -> Self { self.storageslices.push(s); self } - pub fn devices(mut self, d: DeviceInfo) -> Self { self.devices = d; self } - pub fn country(mut self, c: impl ToString) -> Self { self.country = c.to_string(); self } - pub fn capacity(mut self, c: NodeCapacity) -> Self { self.capacity = c; self } - pub fn provisiontime(mut self, t: u32) -> Self { self.provisiontime = t; self } + pub fn nodegroupid(mut self, v: i32) -> Self { + self.nodegroupid = v; + self + } + pub fn uptime(mut self, v: i32) -> Self { + self.uptime = v; + self + } + pub fn add_compute_slice(mut self, s: ComputeSlice) -> Self { + self.computeslices.push(s); + self + } + pub fn add_storage_slice(mut self, s: StorageSlice) -> Self { + self.storageslices.push(s); + self + } + pub fn devices(mut self, d: DeviceInfo) -> Self { + self.devices = d; + self + } + pub fn country(mut self, c: impl ToString) -> Self { + self.country = c.to_string(); + self + } + pub fn capacity(mut self, c: NodeCapacity) -> Self { + self.capacity = c; + self + } + pub fn provisiontime(mut self, t: u32) -> Self { + self.provisiontime = t; + self + } /// Placeholder for capacity recalculation out of the devices on the Node - pub fn recalc_capacity(mut self) -> Self { + pub fn recalc_capacity(self) -> Self { // TODO: calculate NodeCapacity out of the devices on the Node self } diff --git a/heromodels/src/models/heroledger/dnsrecord.rs b/heromodels/src/models/heroledger/dnsrecord.rs index 47fc162..386bede 100644 --- a/heromodels/src/models/heroledger/dnsrecord.rs +++ b/heromodels/src/models/heroledger/dnsrecord.rs @@ -1,4 +1,4 @@ -use heromodels_core::{Model, BaseModelData, IndexKey}; +use heromodels_core::{BaseModelData, IndexKey, Model}; use heromodels_derive::model; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -297,5 +297,3 @@ impl DNSZone { self } } - - diff --git a/heromodels/src/models/heroledger/group.rs b/heromodels/src/models/heroledger/group.rs index a01b98d..73dac02 100644 --- a/heromodels/src/models/heroledger/group.rs +++ b/heromodels/src/models/heroledger/group.rs @@ -1,4 +1,4 @@ -use heromodels_core::{Model, BaseModelData, IndexKey}; +use heromodels_core::{BaseModelData, IndexKey, Model}; use heromodels_derive::model; use serde::{Deserialize, Serialize}; @@ -184,8 +184,6 @@ impl Group { } } - - /// Represents the membership relationship between users and groups #[model] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -232,5 +230,3 @@ impl UserGroupMembership { self } } - - diff --git a/heromodels/src/models/heroledger/membership.rs b/heromodels/src/models/heroledger/membership.rs index bce12b5..8916457 100644 --- a/heromodels/src/models/heroledger/membership.rs +++ b/heromodels/src/models/heroledger/membership.rs @@ -1,4 +1,4 @@ -use heromodels_core::{Model, BaseModelData, IndexKey}; +use heromodels_core::{BaseModelData, IndexKey, Model}; use heromodels_derive::model; use serde::{Deserialize, Serialize}; @@ -111,5 +111,3 @@ impl Member { self } } - - diff --git a/heromodels/src/models/heroledger/mod.rs b/heromodels/src/models/heroledger/mod.rs index 3b1f795..4882238 100644 --- a/heromodels/src/models/heroledger/mod.rs +++ b/heromodels/src/models/heroledger/mod.rs @@ -1,20 +1,10 @@ // Export all heroledger model modules -pub mod user; -pub mod group; -pub mod money; -pub mod membership; pub mod dnsrecord; +pub mod group; +pub mod membership; +pub mod money; +pub mod rhai; pub mod secretbox; pub mod signature; +pub mod user; pub mod user_kvs; -pub mod rhai; - -// Re-export key types for convenience -pub use user::{User, UserStatus, UserProfile, KYCInfo, KYCStatus, SecretBox}; -pub use group::{Group, UserGroupMembership, GroupStatus, Visibility, GroupConfig}; -pub use money::{Account, Asset, AccountPolicy, AccountPolicyItem, Transaction, AccountStatus, TransactionType, Signature as TransactionSignature}; -pub use membership::{Member, MemberRole, MemberStatus}; -pub use dnsrecord::{DNSZone, DNSRecord, SOARecord, NameType, NameCat, DNSZoneStatus}; -pub use secretbox::{Notary, NotaryStatus, SecretBoxCategory}; -pub use signature::{Signature, SignatureStatus, ObjectType}; -pub use user_kvs::{UserKVS, UserKVSItem}; diff --git a/heromodels/src/models/heroledger/money.rs b/heromodels/src/models/heroledger/money.rs index 9bcb02d..e8d1b5d 100644 --- a/heromodels/src/models/heroledger/money.rs +++ b/heromodels/src/models/heroledger/money.rs @@ -1,4 +1,4 @@ -use heromodels_core::{Model, BaseModelData, IndexKey}; +use heromodels_core::{BaseModelData, IndexKey, Model}; use heromodels_derive::model; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -223,8 +223,6 @@ impl Account { } } - - /// Represents an asset in the financial system #[model] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -342,8 +340,6 @@ impl Asset { } } - - /// Represents account policies for various operations #[model] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -400,8 +396,6 @@ impl AccountPolicy { } } - - /// Represents a financial transaction #[model] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -511,5 +505,3 @@ impl Transaction { self } } - - diff --git a/heromodels/src/models/heroledger/rhai.rs b/heromodels/src/models/heroledger/rhai.rs index 30f3f40..53b2f11 100644 --- a/heromodels/src/models/heroledger/rhai.rs +++ b/heromodels/src/models/heroledger/rhai.rs @@ -1,8 +1,13 @@ use ::rhai::plugin::*; -use ::rhai::{Array, Dynamic, Engine, EvalAltResult, Map, Module}; +use ::rhai::{Dynamic, Engine, EvalAltResult, Module}; use std::mem; -use crate::models::heroledger::*; +use crate::models::heroledger::{ + dnsrecord::DNSZone, + group::{Group, Visibility}, + money::Account, + user::{User, UserStatus}, +}; // ============================================================================ // User Module @@ -12,6 +17,8 @@ type RhaiUser = User; #[export_module] mod rhai_user_module { + use crate::models::heroledger::user::User; + use super::RhaiUser; #[rhai_fn(name = "new_user", return_raw)] @@ -30,30 +37,21 @@ mod rhai_user_module { } #[rhai_fn(name = "add_email", return_raw)] - pub fn add_email( - user: &mut RhaiUser, - email: String, - ) -> Result> { + pub fn add_email(user: &mut RhaiUser, email: String) -> Result> { let owned = std::mem::take(user); *user = owned.add_email(email); Ok(user.clone()) } #[rhai_fn(name = "pubkey", return_raw)] - pub fn set_pubkey( - user: &mut RhaiUser, - pubkey: String, - ) -> Result> { + pub fn set_pubkey(user: &mut RhaiUser, pubkey: String) -> Result> { let owned = std::mem::take(user); *user = owned.pubkey(pubkey); Ok(user.clone()) } #[rhai_fn(name = "status", return_raw)] - pub fn set_status( - user: &mut RhaiUser, - status: String, - ) -> Result> { + pub fn set_status(user: &mut RhaiUser, status: String) -> Result> { let status_enum = match status.as_str() { "Active" => UserStatus::Active, "Inactive" => UserStatus::Inactive, @@ -115,10 +113,7 @@ mod rhai_group_module { } #[rhai_fn(name = "name", return_raw)] - pub fn set_name( - group: &mut RhaiGroup, - name: String, - ) -> Result> { + pub fn set_name(group: &mut RhaiGroup, name: String) -> Result> { let owned = std::mem::take(group); *group = owned.name(name); Ok(group.clone()) @@ -263,15 +258,11 @@ mod rhai_dns_zone_module { Ok(zone.clone()) } - - #[rhai_fn(name = "save_dns_zone", return_raw)] pub fn save_dns_zone(zone: &mut RhaiDNSZone) -> Result> { Ok(zone.clone()) } - - // Getters #[rhai_fn(name = "get_id")] pub fn get_id(zone: &mut RhaiDNSZone) -> i64 { diff --git a/heromodels/src/models/heroledger/secretbox.rs b/heromodels/src/models/heroledger/secretbox.rs index 4f93e39..4c514f0 100644 --- a/heromodels/src/models/heroledger/secretbox.rs +++ b/heromodels/src/models/heroledger/secretbox.rs @@ -1,4 +1,4 @@ -use heromodels_core::{Model, BaseModelData, IndexKey}; +use heromodels_core::{BaseModelData, IndexKey, Model}; use heromodels_derive::model; use serde::{Deserialize, Serialize}; @@ -138,5 +138,3 @@ impl Notary { self } } - - diff --git a/heromodels/src/models/heroledger/signature.rs b/heromodels/src/models/heroledger/signature.rs index c97cf89..9e7927e 100644 --- a/heromodels/src/models/heroledger/signature.rs +++ b/heromodels/src/models/heroledger/signature.rs @@ -1,4 +1,4 @@ -use heromodels_core::{Model, BaseModelData, IndexKey}; +use heromodels_core::{BaseModelData, IndexKey, Model}; use heromodels_derive::model; use serde::{Deserialize, Serialize}; @@ -116,5 +116,3 @@ impl Signature { self } } - - diff --git a/heromodels/src/models/heroledger/user.rs b/heromodels/src/models/heroledger/user.rs index b9d34d3..802ae29 100644 --- a/heromodels/src/models/heroledger/user.rs +++ b/heromodels/src/models/heroledger/user.rs @@ -1,4 +1,4 @@ -use heromodels_core::{Model, BaseModelData, IndexKey}; +use heromodels_core::{BaseModelData, IndexKey, Model}; use heromodels_derive::model; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -366,5 +366,3 @@ impl User { self } } - - diff --git a/heromodels/src/models/heroledger/user_kvs.rs b/heromodels/src/models/heroledger/user_kvs.rs index da64ecf..317a163 100644 --- a/heromodels/src/models/heroledger/user_kvs.rs +++ b/heromodels/src/models/heroledger/user_kvs.rs @@ -1,7 +1,7 @@ -use heromodels_core::{Model, BaseModelData, IndexKey}; +use super::secretbox::SecretBox; +use heromodels_core::{BaseModelData, IndexKey, Model}; use heromodels_derive::model; use serde::{Deserialize, Serialize}; -use super::secretbox::SecretBox; /// Represents a per-user key-value store #[model] @@ -44,8 +44,6 @@ impl UserKVS { } } - - /// Represents an item in a user's key-value store #[model] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)] @@ -116,5 +114,3 @@ impl UserKVSItem { self } } - - diff --git a/heromodels/src/models/identity/kyc.rs b/heromodels/src/models/identity/kyc.rs index 5789794..b9d76ff 100644 --- a/heromodels/src/models/identity/kyc.rs +++ b/heromodels/src/models/identity/kyc.rs @@ -46,4 +46,4 @@ pub struct IdenfyVerificationData { pub doc_issuing_country: Option, #[serde(rename = "manuallyDataChanged")] pub manually_data_changed: Option, -} \ No newline at end of file +} diff --git a/heromodels/src/models/identity/mod.rs b/heromodels/src/models/identity/mod.rs index fbfd92c..5505922 100644 --- a/heromodels/src/models/identity/mod.rs +++ b/heromodels/src/models/identity/mod.rs @@ -2,4 +2,4 @@ pub mod kyc; -pub use kyc::*; \ No newline at end of file +pub use kyc::*; diff --git a/heromodels/src/models/location/address.rs b/heromodels/src/models/location/address.rs index cf5a7e8..ad97fd3 100644 --- a/heromodels/src/models/location/address.rs +++ b/heromodels/src/models/location/address.rs @@ -8,4 +8,4 @@ pub struct Address { pub postal_code: String, pub country: String, pub company: Option, -} \ No newline at end of file +} diff --git a/heromodels/src/models/mod.rs b/heromodels/src/models/mod.rs index 43ec774..59f0771 100644 --- a/heromodels/src/models/mod.rs +++ b/heromodels/src/models/mod.rs @@ -10,16 +10,16 @@ pub mod contact; pub mod finance; pub mod flow; pub mod governance; +pub mod grid4; pub mod heroledger; +pub mod identity; pub mod legal; pub mod library; pub mod location; pub mod object; -pub mod projects; pub mod payment; -pub mod identity; -pub mod tfmarketplace; -pub mod grid4; +pub mod projects; +// pub mod tfmarketplace; // Re-export key types for convenience pub use core::Comment; diff --git a/heromodels/src/models/object/object_rhai_dsl.rs b/heromodels/src/models/object/object_rhai_dsl.rs index 13a8578..7f2c214 100644 --- a/heromodels/src/models/object/object_rhai_dsl.rs +++ b/heromodels/src/models/object/object_rhai_dsl.rs @@ -1,6 +1,6 @@ +use super::Object; use rhai::plugin::*; use rhai::{CustomType, Dynamic, Engine, EvalAltResult, Module}; -use super::Object; type RhaiObject = Object; @@ -16,10 +16,7 @@ pub mod generated_rhai_module { /// Set the title of an Object #[rhai_fn(name = "object_title")] - pub fn object_title( - object: &mut RhaiObject, - title: String, - ) -> RhaiObject { + pub fn object_title(object: &mut RhaiObject, title: String) -> RhaiObject { let mut result = object.clone(); result.title = title; result @@ -27,10 +24,7 @@ pub mod generated_rhai_module { /// Set the description of an Object #[rhai_fn(name = "object_description")] - pub fn object_description( - object: &mut RhaiObject, - description: String, - ) -> RhaiObject { + pub fn object_description(object: &mut RhaiObject, description: String) -> RhaiObject { let mut result = object.clone(); result.description = description; result diff --git a/heromodels/src/models/payment/mod.rs b/heromodels/src/models/payment/mod.rs index 19931b5..1959073 100644 --- a/heromodels/src/models/payment/mod.rs +++ b/heromodels/src/models/payment/mod.rs @@ -2,4 +2,4 @@ pub mod stripe; -pub use stripe::*; \ No newline at end of file +pub use stripe::*; diff --git a/heromodels/src/models/payment/stripe.rs b/heromodels/src/models/payment/stripe.rs index 0839d18..4799cd8 100644 --- a/heromodels/src/models/payment/stripe.rs +++ b/heromodels/src/models/payment/stripe.rs @@ -27,4 +27,4 @@ pub struct StripeEventData { pub struct StripeEventRequest { pub id: Option, pub idempotency_key: Option, -} \ No newline at end of file +}