into string should not modify strings (#15320)

# Description

`into string` should not modify input strings (even with the
`--group-digits` flag). It's a conversion command, not a formatting
command.

# User-Facing Changes

- For strings, the same behavior from 0.102.0 is preserved.
- Errors are no longer turned into strings, but rather they are returned
as is.

# After Submitting

Create a `format int` and/or `format float` command and so that the
`--group-digits` flag can be transferred to one of those commands.
This commit is contained in:
Ian Manske
2025-03-16 13:11:05 -07:00
committed by GitHub
parent 83de8560ee
commit c949d2e893
2 changed files with 4 additions and 18 deletions

View File

@ -1474,10 +1474,6 @@ impl<'de> Deserialize<'de> for ShellError {
}
}
pub fn into_code(err: &ShellError) -> Option<String> {
err.code().map(|code| code.to_string())
}
#[test]
fn shell_error_serialize_roundtrip() {
// Ensure that we can serialize and deserialize `ShellError`, and check that it basically would