From 26555a0de070edba38e5c8ae0c9a5e8c37a04b29 Mon Sep 17 00:00:00 2001 From: Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> Date: Wed, 8 Jun 2022 10:14:18 +0100 Subject: [PATCH] Format all multi-line strings to get rid of warnings on rustfmt (#249) --- logos-derive/src/graph/mod.rs | 8 ++++---- logos-derive/src/lib.rs | 12 ++++++------ logos-derive/src/parser/definition.rs | 4 ++-- logos-derive/src/parser/ignore_flags.rs | 8 ++++---- logos-derive/src/parser/mod.rs | 8 ++++---- logos-derive/src/parser/type_params.rs | 4 ++-- logos/src/lib.rs | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/logos-derive/src/graph/mod.rs b/logos-derive/src/graph/mod.rs index 71cc1e74..f82330f4 100644 --- a/logos-derive/src/graph/mod.rs +++ b/logos-derive/src/graph/mod.rs @@ -264,8 +264,8 @@ impl Graph { 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" ); } @@ -453,8 +453,8 @@ impl Index for Graph { fn index(&self, id: NodeId) -> &Node { 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", ) } diff --git a/logos-derive/src/lib.rs b/logos-derive/src/lib.rs index 5c92971b..b5ccb4b3 100644 --- a/logos-derive/src/lib.rs +++ b/logos-derive/src/lib.rs @@ -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\ ", @@ -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\ ", @@ -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})]\ ", diff --git a/logos-derive/src/parser/definition.rs b/logos-derive/src/parser/definition.rs index 98a24dcf..a876fb59 100644 --- a/logos-derive/src/parser/definition.rs +++ b/logos-derive/src/parser/definition.rs @@ -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 diff --git a/logos-derive/src/parser/ignore_flags.rs b/logos-derive/src/parser/ignore_flags.rs index 7b2f85cb..d88a9288 100644 --- a/logos-derive/src/parser/ignore_flags.rs +++ b/logos-derive/src/parser/ignore_flags.rs @@ -80,8 +80,8 @@ impl IgnoreFlags { parser.err( format!( "\ - Unknown flag: {}\n\n\ - + Unknown flag: {}\n\ + \n\ Expected one of: case, ascii_case\ ", unknown @@ -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(), diff --git a/logos-derive/src/parser/mod.rs b/logos-derive/src/parser/mod.rs index 2f2215af..3d656c9b 100644 --- a/logos-derive/src/parser/mod.rs +++ b/logos-derive/src/parser/mod.rs @@ -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\ ", @@ -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(), diff --git a/logos-derive/src/parser/type_params.rs b/logos-derive/src/parser/type_params.rs index c92809a3..268de40a 100644 --- a/logos-derive/src/parser/type_params.rs +++ b/logos-derive/src/parser/type_params.rs @@ -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, ), diff --git a/logos/src/lib.rs b/logos/src/lib.rs index 069b06fc..79b11839 100644 --- a/logos/src/lib.rs +++ b/logos/src/lib.rs @@ -299,9 +299,9 @@ pub enum Filter { /// 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}; ///