return parsed command

This commit is contained in:
Brett Mayson
2024-05-15 00:48:37 +00:00
parent f03b85b95d
commit 63efa7ca17
4 changed files with 6 additions and 6 deletions

2
Cargo.lock generated
View File

@@ -49,7 +49,7 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
[[package]]
name = "arma3-wiki"
version = "0.1.15"
version = "0.1.16"
dependencies = [
"directories",
"fs_extra",

View File

@@ -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]

View File

@@ -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) {

View File

@@ -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,