chaokunyang commented on code in PR #2765:
URL: https://github.com/apache/fory/pull/2765#discussion_r2429577176
##########
rust/fory-core/src/meta/meta_string.rs:
##########
@@ -77,8 +76,9 @@ impl MetaString {
) -> Result<Self, Error> {
let mut strip_last_char = false;
if encoding != Encoding::Utf8 {
- ensure!(!bytes.is_empty(), anyhow!("Encoded data cannot be
empty"));
-
+ if bytes.is_empty() {
+ bail!("Encoded data cannot be empty");
Review Comment:
this should return `EncodeError`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]