- Fix cargo clippy errors

R Aadarsh created

- Add workspace-hack as a dependency

Change summary

Cargo.lock                  | 1 +
crates/encodings/Cargo.toml | 2 ++
crates/fs/src/encodings.rs  | 8 ++++----
3 files changed, 7 insertions(+), 4 deletions(-)

Detailed changes

Cargo.lock 🔗

@@ -5602,6 +5602,7 @@ dependencies = [
  "ui",
  "util",
  "workspace",
+ "workspace-hack",
 ]
 
 [[package]]

crates/encodings/Cargo.toml 🔗

@@ -16,6 +16,8 @@ settings.workspace = true
 ui.workspace = true
 util.workspace = true
 workspace.workspace = true
+workspace-hack.workspace = true
+
 
 [lints]
 workspace = true

crates/fs/src/encodings.rs 🔗

@@ -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
 }