Skip to content

Commit

Permalink
refactor: use string parameters directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Dec 8, 2024
1 parent db93a97 commit e12a846
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions crates/csslsrs/src/features/colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ mod wasm_bindings {
#[wasm_bindgen]
impl WASMLanguageService {
#[wasm_bindgen]
pub fn get_document_colors(&self, document: JsValue) -> JsValue {
let document_uri = document.as_string().unwrap();
pub fn get_document_colors(&self, document_uri: String) -> JsValue {
let store_document = self.store.get(&Uri::from_str(&document_uri).unwrap());

let document_colors = match store_document {
Expand Down
3 changes: 1 addition & 2 deletions crates/csslsrs/src/features/folding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ mod wasm_bindings {
#[wasm_bindgen]
impl WASMLanguageService {
#[wasm_bindgen]
pub fn get_folding_ranges(&self, document: JsValue) -> JsValue {
let document_uri = document.as_string().unwrap();
pub fn get_folding_ranges(&self, document_uri: String) -> JsValue {
let store_document = self.store.get(&Uri::from_str(&document_uri).unwrap());

let folding_ranges = match store_document {
Expand Down
3 changes: 1 addition & 2 deletions crates/csslsrs/src/features/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ mod wasm_bindings {
#[wasm_bindgen]
impl WASMLanguageService {
#[wasm_bindgen]
pub fn get_hover(&self, document: JsValue, position: JsValue) -> JsValue {
let document_uri = document.as_string().unwrap();
pub fn get_hover(&self, document_uri: String, position: JsValue) -> JsValue {
let store_document = self.store.get(&Uri::from_str(&document_uri).unwrap());

let hover_info = match store_document {
Expand Down

0 comments on commit e12a846

Please sign in to comment.