diff --git a/app/components/crate-sidebar.hbs b/app/components/crate-sidebar.hbs index c91bac3a231..d7b4651fcbb 100644 --- a/app/components/crate-sidebar.hbs +++ b/app/components/crate-sidebar.hbs @@ -24,16 +24,16 @@

Add the following line to your Cargo.toml file:

{{#if (is-clipboard-supported)}} - {{@crate.name}} = "{{@version.num}}" + {{this.tomlSnippet}} {{svg-jar "copy" aria-hidden="true" local-class="copy-icon"}} {{else}} - {{@crate.name}} = "{{@version.num}}" + {{this.tomlSnippet}} {{/if}} diff --git a/app/components/crate-sidebar.js b/app/components/crate-sidebar.js index 2929cc6bf27..a33cfc44a53 100644 --- a/app/components/crate-sidebar.js +++ b/app/components/crate-sidebar.js @@ -21,4 +21,8 @@ export default class DownloadGraph extends Component { } @gt('sortedVersions.length', NUM_VERSIONS) hasMoreVersions; + + get tomlSnippet() { + return `${this.args.crate.name} = "${this.args.version.num}"`; + } }