Skip to content

Commit

Permalink
Format all multi-line strings to get rid of warnings on rustfmt (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejhirsz authored Jun 8, 2022
1 parent 05de3cb commit 26555a0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions logos-derive/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ impl<Leaf> Graph<Leaf> {
match (self.get(a), self.get(b)) {
(None, None) => {
panic!(
"Merging two reserved nodes! This is a bug, please report it:\
"Merging two reserved nodes! This is a bug, please report it:\n\
\n\
https://github.com/maciejhirsz/logos/issues"
);
}
Expand Down Expand Up @@ -453,8 +453,8 @@ impl<Leaf> Index<NodeId> for Graph<Leaf> {

fn index(&self, id: NodeId) -> &Node<Leaf> {
self.get(id).expect(
"Indexing into an empty node. This is a bug, please report it at:\n\n\
"Indexing into an empty node. This is a bug, please report it at:\n\
\n\
https://github.com/maciejhirsz/logos/issues",
)
}
Expand Down
12 changes: 6 additions & 6 deletions logos-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ pub fn logos(input: TokenStream) -> TokenStream {
if attr.path.is_ident("extras") {
parser.err(
"\
#[extras] attribute is deprecated. Use #[logos(extras = Type)] instead.\n\n\
#[extras] attribute is deprecated. Use #[logos(extras = Type)] instead.\n\
\n\
For help with migration see release notes: \
https://github.com/maciejhirsz/logos/releases\
",
Expand Down Expand Up @@ -115,8 +115,8 @@ pub fn logos(input: TokenStream) -> TokenStream {
// TODO: Remove in future versions
parser.err(
"\
Since 0.11 Logos no longer requires the #[end] variant.\n\n\
Since 0.11 Logos no longer requires the #[end] variant.\n\
\n\
For help with migration see release notes: \
https://github.com/maciejhirsz/logos/releases\
",
Expand Down Expand Up @@ -258,8 +258,8 @@ pub fn logos(input: TokenStream) -> TokenStream {
parser.err(
format!(
"\
A definition of variant `{0}` can match the same input as another definition of variant `{1}`.\n\n\
A definition of variant `{0}` can match the same input as another definition of variant `{1}`.\n\
\n\
hint: Consider giving one definition a higher priority: \
#[regex(..., priority = {2})]\
",
Expand Down
4 changes: 2 additions & 2 deletions logos-derive/src/parser/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ impl Definition {
parser.err(
format!(
"\
Unknown nested attribute: {}\n\n\
Unknown nested attribute: {}\n\
\n\
Expected one of: priority, callback\
",
unknown
Expand Down
8 changes: 4 additions & 4 deletions logos-derive/src/parser/ignore_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ impl IgnoreFlags {
parser.err(
format!(
"\
Unknown flag: {}\n\n\
Unknown flag: {}\n\
\n\
Expected one of: case, ascii_case\
",
unknown
Expand Down Expand Up @@ -125,8 +125,8 @@ impl IgnoreFlags {
_ => {
parser.err(
"\
Invalid ignore flag\n\n\
Invalid ignore flag\n\
\n\
Expected one of: case, ascii_case\
",
name.span(),
Expand Down
8 changes: 4 additions & 4 deletions logos-derive/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ impl Parser {
// TODO: Remove in future versions
self.err(
"\
trivia are no longer supported.\n\n\
trivia are no longer supported.\n\
\n\
For help with migration see release notes: \
https://github.com/maciejhirsz/logos/releases\
",
Expand Down Expand Up @@ -178,8 +178,8 @@ impl Parser {
_ => {
self.err(
"\
Expected a named argument at this position\n\n\
Expected a named argument at this position\n\
\n\
hint: If you are trying to define a callback here use: callback = ...\
",
tokens.span(),
Expand Down
4 changes: 2 additions & 2 deletions logos-derive/src/parser/type_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ impl TypeParams {
None => {
errors.err(
format!(
"Generic type parameter without a concrete type\n\n\
"Generic type parameter without a concrete type\n\
\n\
Define a concrete type Logos can use: #[logos(type {} = Type)]",
ty,
),
Expand Down
4 changes: 2 additions & 2 deletions logos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ pub enum Filter<T> {

/// Type that can be returned from a callback, either producing a field
/// for a token, skipping it, or emitting an error.
///
///
/// # Example
///
///
/// ```rust
/// use logos::{Logos, FilterResult};
///
Expand Down

0 comments on commit 26555a0

Please sign in to comment.