Cargo.lock 🔗
@@ -5602,6 +5602,7 @@ dependencies = [
"ui",
"util",
"workspace",
+ "workspace-hack",
]
[[package]]
R Aadarsh created
- Add workspace-hack as a dependency
Cargo.lock | 1 +
crates/encodings/Cargo.toml | 2 ++
crates/fs/src/encodings.rs | 8 ++++----
3 files changed, 7 insertions(+), 4 deletions(-)
@@ -5602,6 +5602,7 @@ dependencies = [
"ui",
"util",
"workspace",
+ "workspace-hack",
]
[[package]]
@@ -16,6 +16,8 @@ settings.workspace = true
ui.workspace = true
util.workspace = true
workspace.workspace = true
+workspace-hack.workspace = true
+
[lints]
workspace = true
@@ -86,11 +86,11 @@ impl EncodingWrapper {
}
/// Convert a byte vector from a specified encoding to a UTF-8 string.
-pub async fn to_utf8<'a>(input: Vec<u8>, encoding: EncodingWrapper) -> Result<String> {
- Ok(encoding.decode(input).await?)
+pub async fn to_utf8(input: Vec<u8>, encoding: EncodingWrapper) -> Result<String> {
+ encoding.decode(input).await
}
/// Convert a UTF-8 string to a byte vector in a specified encoding.
-pub async fn from_utf8<'a>(input: String, target: EncodingWrapper) -> Result<Vec<u8>> {
- Ok(target.encode(input).await?)
+pub async fn from_utf8(input: String, target: EncodingWrapper) -> Result<Vec<u8>> {
+ target.encode(input).await
}