From 8e72665aa9faec1c3255a035f47de89b24b8786e Mon Sep 17 00:00:00 2001 From: Genaro Camele Date: Tue, 5 Jul 2022 12:25:11 -0300 Subject: [PATCH] Updated to 0.1.5 to include #6 changes + Formatted errors.rs --- Cargo.toml | 2 +- src/error.rs | 34 ++++++++++++++++------------------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 461e89c..e980f6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ keywords = ["serialization", "deserialization", "serde", "serialize", "deseriali license = "MIT" name = "serde_gura" repository = "https://github.com/gura-conf/serde-gura" -version = "0.1.4" +version = "0.1.5" [dependencies] gura = "0.5.0" diff --git a/src/error.rs b/src/error.rs index 81fc438..70baa4e 100644 --- a/src/error.rs +++ b/src/error.rs @@ -67,38 +67,36 @@ impl Display for Error { Eof => f.write_str("Unexpected end of input"), UnitNotSupported => f.write_str("Unit values are not supported in Gura"), - ExpectedBytes => f.write_str("Expected byte sequence"), + ExpectedBytes => f.write_str("Expected byte sequence"), ExpectedBoolean => f.write_str("Expected boolean"), ExpectedInteger => f.write_str("Expected integer"), - ExpectedFloat => f.write_str( - concat!( - "Expected float: perhaps you forgot decimal fractional part", - " (No implicit coversion between int and float, ", - "see https://gura.netlify.app/docs/spec#float)" - ) - ), - ExpectedChar => f.write_str("Expected char"), - ExpectedString => f.write_str("Expected string"), - ExpectedNull => f.write_str("Expected null value"), - ExpectedArray => f.write_str("Expected array"), + ExpectedFloat => f.write_str(concat!( + "Expected float: perhaps you forgot decimal fractional part", + " (No implicit coversion between int and float, ", + "see https://gura.netlify.app/docs/spec#float)" + )), + ExpectedChar => f.write_str("Expected char"), + ExpectedString => f.write_str("Expected string"), + ExpectedNull => f.write_str("Expected null value"), + ExpectedArray => f.write_str("Expected array"), ExpectedArrayEnd => f.write_str("Expected array end"), - ExpectedMap => f.write_str("Expected map"), + ExpectedMap => f.write_str("Expected map"), ExpectedMapColon => f.write_str("Expected colon at map"), ExpectedMapComma => f.write_str("Expected comma at map"), - ExpectedMapEnd => f.write_str("Expected map end"), + ExpectedMapEnd => f.write_str("Expected map end"), - ExpectedEnum => f.write_str("Expected enum value"), + ExpectedEnum => f.write_str("Expected enum value"), ExpectedObjectValue => f.write_str("Expected not empty object block"), - TrailingCharacters => f.write_str("Invalid trailing characters"), + TrailingCharacters => f.write_str("Invalid trailing characters"), ExpectedUnitVariant => f.write_str("Expected unit variant at enum"), - ExpectedArrayComma => f.write_str("Expected comma at array"), + ExpectedArrayComma => f.write_str("Expected comma at array"), InvalidType => f.write_str("Invalid type"), - ExpectedIdentifier => f.write_str("Expected identifier") + ExpectedIdentifier => f.write_str("Expected identifier"), } } }