asteracea_proc-macro-definitions 0.0.2

Proc macro definitions for Asteracea. They are unlikely to work correctly unless used through the asteracea crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use syn::{Error, Result};

pub trait MapMessage {
	fn map_message(self, message: &str) -> Self;
}

impl<T> MapMessage for Result<T> {
	fn map_message(self, message: &str) -> Self {
		self.map_err(|error| Error::new(error.span(), message))
	}
}