blob: 25f70929ccf82d35c4c32866fba493f3dc895faa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
@use crate::templates::target_cfg;
@use rich_crate::RichDep;
@use kitchen_sink::Target;
@use crate::Urler;
@use crate::CratePage;
@(c: &CratePage, url: &Urler, set: &[RichDep], label: Option<&str>)
@for d in set.iter() {
<li property="requirements" class="@if d.dep.optional() {optional}">
@if let Some(label) = label {
<span class="label label-@label">
@label
</span>
}
@if d.dep.optional() {
@for (f, enabled) in &d.only_for_features {
<span class="feature" title="optional feature">@if *enabled {@f} else {@f?}</span>
}
@if d.only_for_features.is_empty() {
<span class="feature" title="optional feature">
optional
</span>
}
}
@for t in &d.only_for_targets {
@if let Target::Cfg(t) = t {
@:target_cfg(t)
} else {
<span class="cfg k">@t</span>
}
}
@if !d.dep.is_crates_io() {<span class="label label-git">git</span> }<a
href="@url.dependency(d)">@d.package</a>@if let Some(updclass)=Some(c.up_to_date_class(d)) {@if updclass != "common" { <span class="version @updclass">@c.pretty_print_req(d.dep.req())</span>}}@for f in d.dep.req_features() {<span class="with-feature"><wbr>+<span>@f</span></span>}
</li>
}
|