tags: Move impls below type definitions

This commit is contained in:
Max Brunsfeld 2020-07-09 11:30:30 -07:00
parent b52f28d6d5
commit 1ecfc2548f

View file

@ -63,15 +63,6 @@ pub enum Error {
InvalidCapture(String),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::InvalidCapture(name) => write!(f, "Invalid capture @{}. Expected one of: @definition.*, @reference.*, @doc, @name, @local.(scope|definition|reference).", name),
_ => write!(f, "{:?}", self)
}
}
}
#[derive(Debug, Default)]
struct PatternInfo {
docs_adjacent_capture: Option<u32>,
@ -475,6 +466,15 @@ where
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::InvalidCapture(name) => write!(f, "Invalid capture @{}. Expected one of: @definition.*, @reference.*, @doc, @name, @local.(scope|definition|reference).", name),
_ => write!(f, "{:?}", self)
}
}
}
impl From<regex::Error> for Error {
fn from(error: regex::Error) -> Self {
Error::Regex(error)