Ai
4 Star 16 Fork 0

Gitee 极速下载/intellij-rust

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/intellij-rust/intellij-rust
克隆/下载
formatter.rs 933 Bytes
一键复制 编辑 原始数据 按行查看 历史
vlad20012 提交于 2023-04-04 23:26 +08:00 . CLEAN: move json formatter to a separate file
use std::io;
use std::io::Write;
use serde_json::ser::{Formatter, PrettyFormatter};
pub(crate) struct MyFormatter {
pretty_formatter: PrettyFormatter<'static>
}
impl MyFormatter {
pub(crate) fn new() -> Self {
MyFormatter { pretty_formatter: PrettyFormatter::new() }
}
}
impl Formatter for MyFormatter {
fn begin_array<W: ?Sized + Write>(&mut self, writer: &mut W) -> io::Result<()> {
self.pretty_formatter.begin_array(writer)
}
fn end_array<W: ?Sized + Write>(&mut self, writer: &mut W) -> io::Result<()> {
self.pretty_formatter.end_array(writer)
}
fn begin_array_value<W: ?Sized + Write>(&mut self, writer: &mut W, first: bool) -> io::Result<()> {
self.pretty_formatter.begin_array_value(writer, first)
}
fn end_array_value<W: ?Sized + Write>(&mut self, writer: &mut W) -> io::Result<()> {
self.pretty_formatter.end_array_value(writer)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/mirrors/intellij-rust.git
git@gitee.com:mirrors/intellij-rust.git
mirrors
intellij-rust
intellij-rust
master

搜索帮助