14 lines
386 B
Rust
14 lines
386 B
Rust
use color_eyre::eyre::Result;
|
|
use tracing::error;
|
|
|
|
use crate::{Error, State};
|
|
|
|
pub fn remove(state: &mut State, tag: &str, object: &str) -> Result<()> {
|
|
if state.tags.get(object).is_none() {
|
|
error!("No {object} in .state.json");
|
|
return Err(Error::ObjectDoesntExist(object.to_string()).into());
|
|
}
|
|
state.tags.get_mut(object).unwrap().remove(tag);
|
|
Ok(())
|
|
}
|