(info: ViewInfo, current: &str)
| 164 | |
| 165 | impl ViewEntry { |
| 166 | fn from_info(info: ViewInfo, current: &str) -> Self { |
| 167 | let kind = match info.kind_label() { |
| 168 | "draft" => "draft", |
| 169 | _ => "shared", |
| 170 | }; |
| 171 | let is_current = info.name == current; |
| 172 | let state_short = info.state_short(); |
| 173 | ViewEntry { |
| 174 | name: info.name, |
| 175 | parent: info.parent_name, |
| 176 | own_change_count: info.own_change_count, |
| 177 | change_count: info.change_count, |
| 178 | inherited_change_count: info.inherited_change_count, |
| 179 | kind, |
| 180 | state_short, |
| 181 | is_current, |
| 182 | has_info: true, |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | /// A name-only entry used when view metadata is unavailable. Treated as |
| 187 | /// having changes so it is never hidden from the listing. |
nothing calls this directly
no test coverage detected