mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
Fix natvis VecDeque
formatter
This commit is contained in:
parent
acf95adfe2
commit
cd68bd9bab
@ -12,20 +12,19 @@
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="alloc::collections::vec_deque::VecDeque<*>">
|
||||
<DisplayString>{{ len={tail <= head ? head - tail : buf.cap - tail + head} }}</DisplayString>
|
||||
<DisplayString>{{ len={len} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[len]" ExcludeView="simple">tail <= head ? head - tail : buf.cap - tail + head</Item>
|
||||
<Item Name="[len]" ExcludeView="simple">len</Item>
|
||||
<Item Name="[capacity]" ExcludeView="simple">buf.cap</Item>
|
||||
<CustomListItems>
|
||||
<Variable Name="i" InitialValue="tail" />
|
||||
|
||||
<Size>tail <= head ? head - tail : buf.cap - tail + head</Size>
|
||||
<Variable Name="i" InitialValue="0" />
|
||||
<Size>len</Size>
|
||||
<Loop>
|
||||
<If Condition="i == head">
|
||||
<If Condition="i == len">
|
||||
<Break/>
|
||||
</If>
|
||||
<Item>buf.ptr.pointer.pointer[i]</Item>
|
||||
<Exec>i = (i + 1 == buf.cap ? 0 : i + 1)</Exec>
|
||||
<Item>buf.ptr.pointer.pointer[(i + head) % buf.cap]</Item>
|
||||
<Exec>i = i + 1</Exec>
|
||||
</Loop>
|
||||
</CustomListItems>
|
||||
</Expand>
|
||||
|
Loading…
Reference in New Issue
Block a user