Browse Source

allow paths in format expressions

Evan Almloff 2 năm trước cách đây
mục cha
commit
e0563bd637
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      packages/rsx/src/ifmt.rs

+ 5 - 0
packages/rsx/src/ifmt.rs

@@ -59,6 +59,11 @@ impl FromStr for IfmtInput {
                 let mut current_captured = String::new();
                 while let Some(c) = chars.next() {
                     if c == ':' {
+                        // two :s in a row is a path, not a format arg
+                        if chars.next_if(|c| *c == ':').is_some() {
+                            current_captured.push_str("::");
+                            continue;
+                        }
                         let mut current_format_args = String::new();
                         for c in chars.by_ref() {
                             if c == '}' {