mirror of
https://github.com/acemod/arma3-wiki.git
synced 2025-12-22 05:37:06 +00:00
return parsed command
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -49,7 +49,7 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
|
||||
|
||||
[[package]]
|
||||
name = "arma3-wiki"
|
||||
version = "0.1.15"
|
||||
version = "0.1.16"
|
||||
dependencies = [
|
||||
"directories",
|
||||
"fs_extra",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "arma3-wiki"
|
||||
description = "A project to store data about Arma 3 commands in a useable format"
|
||||
license = "MIT"
|
||||
version = "0.1.15"
|
||||
version = "0.1.16"
|
||||
edition = "2021"
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -50,10 +50,10 @@ impl Wiki {
|
||||
///
|
||||
/// # Errors
|
||||
/// Returns an error if the command could not be parsed.
|
||||
pub fn add_custom_command_parse(&mut self, command: &str) -> Result<(), String> {
|
||||
pub fn add_custom_command_parse(&mut self, command: &str) -> Result<Command, String> {
|
||||
let command: Command = serde_yaml::from_str(command).map_err(|e| format!("{e}"))?;
|
||||
self.add_custom_command(command);
|
||||
Ok(())
|
||||
self.add_custom_command(command.clone());
|
||||
Ok(command)
|
||||
}
|
||||
|
||||
pub fn remove_command(&mut self, name: &str) {
|
||||
|
||||
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::{Locality, ParseError, Since, Syntax};
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Command {
|
||||
name: String,
|
||||
description: String,
|
||||
|
||||
Reference in New Issue
Block a user