Skip to content

Commit 779c41c

Browse files
committed
Fix unused warnings in former godot-fmt benchmark
1 parent f5e68e8 commit 779c41c

File tree

1 file changed

+4
-2
lines changed
  • godot-codegen/src/formatter

1 file changed

+4
-2
lines changed

godot-codegen/src/formatter/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
66
*/
77

8+
#![cfg(feature = "codegen-fmt")]
9+
810
use proc_macro2::{Delimiter, Spacing, TokenStream, TokenTree};
911

1012
/// Perform a best-effort single-pass formatting pass over a stream of tokens
@@ -50,7 +52,7 @@ use proc_macro2::{Delimiter, Spacing, TokenStream, TokenTree};
5052
/// smoother.
5153
/// Maybe it's worth to make ALL args on their own line, then function calls
5254
/// get big, but `struct`s and `enum`s would be more natural?
53-
pub fn format_tokens(tokens: TokenStream) -> String {
55+
pub(crate) fn format_tokens(tokens: TokenStream) -> String {
5456
let mut out = String::new();
5557

5658
format(FormatState::Start, 0, tokens.into_iter(), &mut out);
@@ -59,7 +61,7 @@ pub fn format_tokens(tokens: TokenStream) -> String {
5961
}
6062

6163
fn indent(n: usize) -> &'static str {
62-
// This looks strange but it means we don't need to actually allocate anything.
64+
// This looks strange, but it means we don't need to actually allocate anything.
6365
// The downside is there's a limit to how deep we can nest.
6466
// The code that's generated doesn't seem like it's any deeper than this.
6567

0 commit comments

Comments
 (0)