mirror of https://github.com/kdl-org/kdl-rs.git
Silence `unused_mut` when only `span` is mutated with `span` feature
This commit is contained in:
parent
c7f60b4c56
commit
dc2839f850
|
|
@ -579,6 +579,8 @@ mod test {
|
|||
);
|
||||
|
||||
let entry: KdlEntry = " \\\n (\"m\\\"eh\")0xDEADbeef\t\\\n".parse()?;
|
||||
#[cfg_attr(not(feature = "span"), allow(unused_mut))]
|
||||
{
|
||||
let mut ty: KdlIdentifier = "\"m\\\"eh\"".parse()?;
|
||||
#[cfg(feature = "span")]
|
||||
{
|
||||
|
|
@ -600,6 +602,7 @@ mod test {
|
|||
span: SourceSpan::from(0..26),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
let entry: KdlEntry = " \\\n \"foo\"=(\"m\\\"eh\")0xDEADbeef\t\\\n".parse()?;
|
||||
assert_eq!(
|
||||
|
|
|
|||
|
|
@ -759,6 +759,7 @@ fn node_children(input: &mut Input<'_>) -> PResult<KdlDocument> {
|
|||
.map(|_| KdlDocument::new())
|
||||
.or_else(|mut e: ErrMode<KdlParseError>| {
|
||||
e = match e {
|
||||
#[cfg_attr(not(feature = "span"), allow(unused_mut))]
|
||||
ErrMode::Cut(mut pe) => {
|
||||
#[cfg(feature = "span")]
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue