flutter_rust_bridge_codegen 2.0.0-dev.0

High-level memory-safe binding generator for Flutter/Dart <-> Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::command_run;
use crate::library::commands::command_runner::{call_shell, check_exit_code};
use crate::library::commands::format_dart::normalize_windows_unc_paths;
use log::debug;
use std::path::PathBuf;

pub fn format_rust(path: &[PathBuf]) -> anyhow::Result<()> {
    let path = normalize_windows_unc_paths(path)?;
    debug!("execute format_rust path={path:?}");
    check_exit_code(&command_run!(
        call_shell[None, None],
        "rustfmt",
        // otherwise cannot understand `async move`
        "--edition",
        "2018",
        *path
    )?)
}