diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-06 23:19:52 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-06 23:19:52 +0100 |
commit | 0ee945e289c438e87d4701401059e8c407710e7b (patch) | |
tree | 6b16e28da049a1f627b26eda1a2595a6b3cd84cd /Cargo.lock | |
parent | 6fccb152b4646877e38dc29dce1b0cd826eb6908 (diff) | |
parent | 90a5dca0a2dbb858ee34eb7de06de8a1cad9e488 (diff) |
Merge #8280
8280: Borrow text of immutable syntax node r=iDawer a=iDawer
In https://github.com/rust-analyzer/rowan/pull/101 `rowan::SyntaxNode::green` returns `Cow<'_, GreenNodeData>`. It returns borrow of green node of immutable syntax tree node.
Using this we can return borrowed text from `ast::Name::text`.
~~However now it allocates in case of mutable syntax trees.~~ (see next comment)
The idea comes from https://github.com/rust-analyzer/rowan/pull/100#issuecomment-809330325
Co-authored-by: Dawer <[email protected]>
Diffstat (limited to 'Cargo.lock')
-rw-r--r-- | Cargo.lock | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Cargo.lock b/Cargo.lock index c411ce8e6..c378014f0 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -1319,9 +1319,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" | |||
1319 | 1319 | ||
1320 | [[package]] | 1320 | [[package]] |
1321 | name = "rowan" | 1321 | name = "rowan" |
1322 | version = "0.13.0-pre.3" | 1322 | version = "0.13.0-pre.5" |
1323 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1323 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1324 | checksum = "77d315d6f2e33f294412faa47f41b56bdb3fce72c999d384b5e78c8d21551b13" | 1324 | checksum = "32a5fc82ed0b7e7fba157331f0d8f64abd73bced6e7ac2a4dfa0c4cf0ab584e8" |
1325 | dependencies = [ | 1325 | dependencies = [ |
1326 | "countme", | 1326 | "countme", |
1327 | "hashbrown", | 1327 | "hashbrown", |