MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / get_indent

Method get_indent

cranelift/srcgen/src/lib.rs:125–131  ·  view source on GitHub ↗

Get the current whitespace indentation in the form of a String.

(&self)

Source from the content-addressed store, hash-verified

123
124 /// Get the current whitespace indentation in the form of a String.
125 fn get_indent(&self) -> String {
126 if self.indent == 0 {
127 String::new()
128 } else {
129 format!("{:-1$}", " ", self.indent * SHIFTWIDTH)
130 }
131 }
132
133 /// Add an indented line.
134 pub fn line(&mut self, contents: impl AsRef<str>) {

Callers 2

line_with_locationMethod · 0.80
get_indent_worksFunction · 0.80

Calls 1

newFunction · 0.50

Tested by 1

get_indent_worksFunction · 0.64