aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-09-24 16:07:35 +0100
committerGitHub <[email protected]>2020-09-24 16:07:35 +0100
commit277488b51e22c790b51d5f739ecb33cdd20e903f (patch)
treec0bc04398f8bd4a008de967af6d70d10817e324d /crates/mbe
parent65592b41be280e0e2ca81c1e127f8cb13fb47ce9 (diff)
parent875ad9b5c410200f5072515ae91b4ff51cff0448 (diff)
Merge #6062
6062: Bump smol_str from 0.1.16 to 0.1.17 r=matklad a=woshilapin When I built `rust-analyzer` today, I noticed the following warnings. ``` warning: use of deprecated item 'syntax::SmolStr::new_inline_from_ascii': Use `new_inline` instead --> crates/mbe/src/syntax_bridge.rs:639:30 | 639 | ... (SmolStr::new_inline_from_ascii(1, &[punct.char as u8]), punct.id) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(deprecated)]` on by default warning: 1 warning emitted ``` So I thought it would be a nice small PR. Co-authored-by: Jean SIMARD <[email protected]>
Diffstat (limited to 'crates/mbe')
-rw-r--r--crates/mbe/src/syntax_bridge.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs
index a8ad917fb..d987b2500 100644
--- a/crates/mbe/src/syntax_bridge.rs
+++ b/crates/mbe/src/syntax_bridge.rs
@@ -636,7 +636,10 @@ impl<'a> TreeSink for TtTreeSink<'a> {
636 let (text, id) = match leaf { 636 let (text, id) = match leaf {
637 tt::Leaf::Ident(ident) => (ident.text.clone(), ident.id), 637 tt::Leaf::Ident(ident) => (ident.text.clone(), ident.id),
638 tt::Leaf::Punct(punct) => { 638 tt::Leaf::Punct(punct) => {
639 (SmolStr::new_inline_from_ascii(1, &[punct.char as u8]), punct.id) 639 assert!(punct.char.is_ascii());
640 let char = &(punct.char as u8);
641 let text = std::str::from_utf8(std::slice::from_ref(char)).unwrap();
642 (SmolStr::new_inline(text), punct.id)
640 } 643 }
641 tt::Leaf::Literal(lit) => (lit.text.clone(), lit.id), 644 tt::Leaf::Literal(lit) => (lit.text.clone(), lit.id),
642 }; 645 };