Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
carloskiki committed Aug 4, 2024
1 parent 96c20cb commit 9a923db
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ pub use event::Event;
#[doc(inline)]
pub use mathml::{push_mathml, write_mathml};
#[doc(inline)]
pub use parser::{Parser, error::ParserError, storage::Storage};
pub use parser::{error::ParserError, storage::Storage, Parser};
5 changes: 4 additions & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,10 @@ mod tests {
#[test]
fn error() {
let store = Storage::new();
let parser = Parser::new(r"\def\blah#1#2{\fra#1#2} \def\abc#1{\blah{a}#1} \abc{b}", &store);
let parser = Parser::new(
r"\def\blah#1#2{\fra#1#2} \def\abc#1{\blah{a}#1} \abc{b}",
&store,
);
let events = parser.collect::<Vec<_>>();

assert!(events[0].is_err());
Expand Down
8 changes: 4 additions & 4 deletions src/parser/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ impl ParserError {
.map(|index| span_stack.expansions[index].full_expansion)
.unwrap_or(span_stack.input);


if lower_bound > expansion.expansion_length {
lower_bound += expansion.call_site_in_origin.start;
upper_bound = (expansion.call_site_in_origin.end + upper_bound).min(next_string.len());

upper_bound =
(expansion.call_site_in_origin.end + upper_bound).min(next_string.len());

continue;
}

let context_str = &expansion.full_expansion[lower_bound..upper_bound];
context.push_str(context_str);
context.push('\n');
Expand Down
8 changes: 3 additions & 5 deletions src/parser/lex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ pub fn definition<'a>(input: &mut &'a str) -> InnerResult<(&'a str, &'a str, &'a
ErrorKind::CommentInParamText
} else {
ErrorKind::BracesInParamText
})
});
}

*input = rest;
let replacement_text = group_content(input, "{", "}")?;

Expand Down Expand Up @@ -148,9 +148,7 @@ pub fn delimiter(input: &mut &str) -> InnerResult<(char, DelimiterType)> {
///
/// Returns the control sequence, the token it should be assigned to, and the rest of the input
/// with both tokens not consumed.
pub fn futurelet_assignment<'a>(
input: &mut &'a str,
) -> InnerResult<(&'a str, Token<'a>, &'a str)> {
pub fn futurelet_assignment<'a>(input: &mut &'a str) -> InnerResult<(&'a str, Token<'a>, &'a str)> {
let control_sequence = control_sequence(input)?;

let input_with_tokens = *input;
Expand Down
1 change: 0 additions & 1 deletion src/parser/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ impl Storage {
self.0.reset();
}
}

2 changes: 1 addition & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use fantoccini::{Client, ClientBuilder, Locator};
use heck::ToTitleCase;
use inventory::collect;
use libtest_mimic::{Arguments, Conclusion, Failed, Trial};
use pulldown_latex::{config::RenderConfig, mathml::push_mathml, Storage, Parser};
use pulldown_latex::{config::RenderConfig, mathml::push_mathml, Parser, Storage};
use tokio::process::Command;

#[allow(clippy::type_complexity)]
Expand Down

0 comments on commit 9a923db

Please sign in to comment.