autocxx_engine/rust_pretty_printer.rs
1// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9use syn::{Item, ItemMod};
10
11pub(crate) fn pretty_print(itm: &ItemMod) -> String {
12 prettyplease::unparse(&syn::File {
13 shebang: None,
14 attrs: Vec::new(),
15 items: vec![Item::Mod(itm.clone())],
16 })
17}