Skip to content

Commit

Permalink
chore: dprint-core 0.65
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jan 14, 2024
1 parent 8460038 commit d2014b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ wasm = ["dprint-core/wasm"]

[dependencies]
anyhow = "1.0.51"
dprint-core = { version = "0.63.3", features = ["formatting"] }
dprint-core = { version = "0.65.0", features = ["formatting"] }
jsonc-parser = "0.23.0"
serde = { version = "1.0.108", features = ["derive"] }
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.74.0"
channel = "1.75.0"
components = ["clippy", "rustfmt"]
14 changes: 10 additions & 4 deletions src/wasm_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,19 @@ impl SyncPluginHandler<Configuration> for JupyterPluginHandler {
fn format(
&mut self,
_file_path: &Path,
file_text: &str,
file_bytes: Vec<u8>,
_config: &Configuration,
mut format_with_host: impl FnMut(&Path, String, &ConfigKeyMap) -> FormatResult,
mut format_with_host: impl FnMut(&Path, Vec<u8>, &ConfigKeyMap) -> FormatResult,
) -> FormatResult {
super::format_text(file_text, |path, text| {
format_with_host(path, text, &ConfigKeyMap::new())
let file_text = String::from_utf8(file_bytes)?;
super::format_text(&file_text, |path, text| {
let maybe_bytes = format_with_host(path, text.into_bytes(), &ConfigKeyMap::new())?;
match maybe_bytes {
Some(bytes) => Ok(Some(String::from_utf8(bytes)?)),
None => Ok(None),
}
})
.map(|maybe_file_text| maybe_file_text.map(|file_text| file_text.into_bytes()))
}
}

Expand Down

0 comments on commit d2014b4

Please sign in to comment.