File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 24
24
<p local-class =" copy-help" >Add the following line to your Cargo.toml file:</p >
25
25
{{ #if (is-clipboard-supported )}}
26
26
<CopyButton
27
- @copyText =' {{ @crate.name }} = " {{ @version.num }} " '
27
+ @copyText ={{ this.tomlSnippet }}
28
28
title =" Copy Cargo.toml snippet to clipboard"
29
29
local-class =" copy-button"
30
30
>
31
- <span >{{ @crate.name }} = " {{ @version.num }} " </span >
31
+ <span >{{ this.tomlSnippet }} </span >
32
32
{{ svg-jar " copy" aria-hidden =" true" local-class =" copy-icon" }}
33
33
</CopyButton >
34
34
{{ else }}
35
35
<code local-class =" copy-fallback" >
36
- {{ @crate.name }} = " {{ @version.num }} "
36
+ {{ this.tomlSnippet }}
37
37
</code >
38
38
{{ /if }}
39
39
</div >
Original file line number Diff line number Diff line change @@ -21,4 +21,8 @@ export default class DownloadGraph extends Component {
21
21
}
22
22
23
23
@gt ( 'sortedVersions.length' , NUM_VERSIONS ) hasMoreVersions ;
24
+
25
+ get tomlSnippet ( ) {
26
+ return `${ this . args . crate . name } = "${ this . args . version . num } "` ;
27
+ }
24
28
}
You can’t perform that action at this time.
0 commit comments