Skip to content

Commit

Permalink
Track caller for invalid namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Sep 27, 2023
1 parent 719465d commit e945d22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ impl NamespaceStack {
///
/// Panics if the stack is empty.
#[inline]
#[track_caller]
pub fn pop(&mut self) -> Namespace {
self.0.pop().unwrap()
}
Expand All @@ -254,6 +255,7 @@ impl NamespaceStack {
///
/// Panics if the stack is empty.
#[inline]
#[track_caller]
pub fn peek_mut(&mut self) -> &mut Namespace {
self.0.last_mut().unwrap()
}
Expand All @@ -263,6 +265,7 @@ impl NamespaceStack {
/// Panics if the stack is empty.
#[inline]
#[must_use]
#[track_caller]
pub fn peek(&self) -> &Namespace {
self.0.last().unwrap()
}
Expand Down
3 changes: 3 additions & 0 deletions src/writer/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ impl Emitter {
result
}

#[track_caller]
fn emit_start_element_initial<W>(&mut self, target: &mut W,
name: Name<'_>,
attributes: &[Attribute<'_>]) -> Result<()>
Expand All @@ -283,6 +284,7 @@ impl Emitter {
Ok(())
}

#[track_caller]
pub fn emit_start_element<W>(&mut self, target: &mut W,
name: Name<'_>,
attributes: &[Attribute<'_>]) -> Result<()>
Expand All @@ -302,6 +304,7 @@ impl Emitter {
Ok(())
}

#[track_caller]
pub fn emit_current_namespace_attributes<W>(&mut self, target: &mut W) -> Result<()>
where W: Write
{
Expand Down

0 comments on commit e945d22

Please sign in to comment.