Skip to content

Commit a3f8608

Browse files
committed
Fix compile errors
1 parent cd7c191 commit a3f8608

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

crates/turborepo-lsp/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ impl LanguageServer for Backend {
325325
let package_json_name = if repo_root.contains(&wd.package_json) {
326326
Some("//")
327327
} else {
328-
package_json.name.as_deref()
328+
package_json.name.as_ref().map(|name| name.as_str())
329329
};
330330

331331
// todo: use jsonc_ast instead of text search
@@ -613,7 +613,7 @@ impl LanguageServer for Backend {
613613
.iter()
614614
.flat_map(|p| p.scripts.keys().map(move |k| (p.name.clone(), k)))
615615
.map(|(package, s)| CompletionItem {
616-
label: format!("{}#{}", package.unwrap_or_default(), s),
616+
label: format!("{}#{}", package.unwrap_or_default().into_inner(), s),
617617
kind: Some(CompletionItemKind::FIELD),
618618
..Default::default()
619619
});
@@ -708,7 +708,7 @@ impl Backend {
708708
{
709709
Some("//".to_string())
710710
} else {
711-
package_json.name
711+
package_json.name.map(|name| name.into_inner())
712712
};
713713
Some(
714714
package_json

packages/turbo-repository/rust/src/internal.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ impl Workspace {
132132
// package_json_path)
133133
path.parent()
134134
.map(|package_path| {
135-
Ok(Package::new(name, &self.workspace_state.root, package_path))
135+
Ok(Package::new(
136+
name.into_inner(),
137+
&self.workspace_state.root,
138+
package_path,
139+
))
136140
})
137141
.or_else(|| Some(Err(Error::MissingParent(path.to_owned()))))
138142
})

0 commit comments

Comments
 (0)