From d2109fce65141b3c1ea83cfbf17e2e41bf0c54a6 Mon Sep 17 00:00:00 2001 From: meeg_leeto Date: Fri, 13 May 2022 16:19:57 +0100 Subject: [PATCH] fix: misc. fix to printing, from bad concatenation --- src/main.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 15ff0cb..db33ca3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -265,15 +265,17 @@ mod conf { eprintln!("IO error when reading configuration file.") } serde_json::error::Category::Syntax => eprintln!( - "Configuration file is syntactically incorrect. - See {}:{}:{}.", + concat!( + "Configuration file is syntactically incorrect.\n", + "See {}:{}:{}." + ), config_file_name, err.line(), err.column() ), serde_json::error::Category::Data => eprintln!( - "Error deserializing configuration file; expected different data type. - See {}:{}:{}.", + concat!("Error deserializing configuration file; expected different data type.\n", + "See {}:{}:{}."), config_file_name, err.line(), err.column() @@ -284,8 +286,8 @@ mod conf { }, ConfigParseError::OldVersion(old_version) => { eprintln!( - "Configuration file has outdated version. - Expected version field to be {} but got {}.", + concat!("Configuration file has outdated version.\n", + "Expected version field to be {} but got {}."), old_version, config_version() ); @@ -672,10 +674,12 @@ mod service { // Collision! response_channel.send(AddResult::Fail).ok(); eprintln!( - "Collision for slug {}! - Slug space may have been exhausted. - If you see this message repeatedly, - consider increasing the slug size.", + concat!( + "Collision for slug {}!\n", + "Slug space may have been exhausted.\n", + "If you see this message repeatedly,", + "consider increasing the slug size." + ), slug_key ); return;