We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
f ".."
1 parent 2506a36 commit f16b9b2Copy full SHA for f16b9b2
macros/src/embed_python.rs
@@ -109,7 +109,16 @@ impl EmbedPython {
109
self.loc = token.span().unwrap().end();
110
}
111
TokenTree::Literal(x) => {
112
- write!(&mut self.python, "{}", x).unwrap();
+ let s = x.to_string();
113
+ // Remove space in prefixed strings like `f ".."`.
114
+ // (`f".."` is not allowed in some versions+editions of Rust.)
115
+ if s.starts_with('"')
116
+ && self.python.ends_with(' ')
117
+ && self.python[..self.python.len() - 1].ends_with(|c: char| c.is_ascii_alphabetic())
118
+ {
119
+ self.python.pop();
120
+ }
121
+ self.python += &s;
122
123
124
0 commit comments