aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r--crates/ra_hir_expand/src/quote.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs
index 35133d216..65a35e52f 100644
--- a/crates/ra_hir_expand/src/quote.rs
+++ b/crates/ra_hir_expand/src/quote.rs
@@ -172,12 +172,12 @@ impl_to_to_tokentrees! {
172 u32 => self { tt::Literal{text: self.to_string().into()} }; 172 u32 => self { tt::Literal{text: self.to_string().into()} };
173 usize => self { tt::Literal{text: self.to_string().into()}}; 173 usize => self { tt::Literal{text: self.to_string().into()}};
174 i32 => self { tt::Literal{text: self.to_string().into()}}; 174 i32 => self { tt::Literal{text: self.to_string().into()}};
175 &str => self { tt::Literal{text: self.to_string().into()}};
176 String => self { tt::Literal{text: self.into()}};
177 tt::Leaf => self { self }; 175 tt::Leaf => self { self };
178 tt::Literal => self { self }; 176 tt::Literal => self { self };
179 tt::Ident => self { self }; 177 tt::Ident => self { self };
180 tt::Punct => self { self } 178 tt::Punct => self { self };
179 &str => self { tt::Literal{text: format!("{:?}", self.escape_default().to_string()).into()}};
180 String => self { tt::Literal{text: format!("{:?}", self.escape_default().to_string()).into()}}
181} 181}
182 182
183#[cfg(test)] 183#[cfg(test)]
@@ -200,7 +200,7 @@ mod tests {
200 let a = 20; 200 let a = 20;
201 assert_eq!(quote!(#a).to_string(), "20"); 201 assert_eq!(quote!(#a).to_string(), "20");
202 let s: String = "hello".into(); 202 let s: String = "hello".into();
203 assert_eq!(quote!(#s).to_string(), "hello"); 203 assert_eq!(quote!(#s).to_string(), "\"hello\"");
204 } 204 }
205 205
206 fn mk_ident(name: &str) -> tt::Ident { 206 fn mk_ident(name: &str) -> tt::Ident {