fix: ci
This commit is contained in:
parent
bdc9b79e42
commit
c61e170b47
@ -1,7 +1,3 @@
|
||||
/// Constants for plugin permissions.
|
||||
///
|
||||
/// Use these in your `PluginMetadata` to request access to specific host features.
|
||||
|
||||
/// Allows the plugin to perform DNS resolution.
|
||||
pub const NETWORK_DNS: &str = "network.dns";
|
||||
|
||||
|
||||
@ -138,6 +138,7 @@ fn load_component(
|
||||
}
|
||||
|
||||
impl WasmPlugin {
|
||||
#[expect(clippy::too_many_lines)]
|
||||
pub async fn on_load(
|
||||
&self,
|
||||
context: Arc<Context>,
|
||||
|
||||
@ -62,10 +62,13 @@ pub async fn init_plugin(
|
||||
authors: metadata.authors,
|
||||
description: metadata.description,
|
||||
dependencies: metadata.dependencies,
|
||||
permissions: metadata.permissions.clone(),
|
||||
permissions: metadata.permissions,
|
||||
};
|
||||
|
||||
store.data_mut().permissions = metadata.permissions.clone();
|
||||
store
|
||||
.data_mut()
|
||||
.permissions
|
||||
.clone_from(&metadata.permissions);
|
||||
|
||||
Ok((
|
||||
WasmPlugin {
|
||||
|
||||
@ -37,11 +37,8 @@ impl pumpkin::plugin::server::HostServer for PluginHostState {
|
||||
let mut sys = sysinfo::System::new_all();
|
||||
sys.refresh_all();
|
||||
|
||||
let cpu_count = if has_perm(permissions::SYS_INFO) || has_perm(permissions::SYS_INFO_CPU) {
|
||||
Some(sys.cpus().len() as u32)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let cpu_count = (has_perm(permissions::SYS_INFO) || has_perm(permissions::SYS_INFO_CPU))
|
||||
.then(|| sys.cpus().len() as u32);
|
||||
|
||||
let (total_memory, used_memory) =
|
||||
if has_perm(permissions::SYS_INFO) || has_perm(permissions::SYS_INFO_RAM) {
|
||||
|
||||
@ -1,8 +1,3 @@
|
||||
/// Constants for plugin permissions.
|
||||
///
|
||||
/// Plugins can request these permissions in their metadata to access specific
|
||||
/// host features.
|
||||
|
||||
/// Allows the plugin to perform DNS resolution (resolving hostnames to IP addresses).
|
||||
///
|
||||
/// Corresponds to the `wasi:sockets/ip-name-lookup` interface.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user