Skip to content

Commit

Permalink
Clarify suggestion to use extern crate in help
Browse files Browse the repository at this point in the history
  • Loading branch information
schuelermine committed Sep 5, 2023
1 parent bc49435 commit 53554db
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ui/frontend/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const ORIGINAL_PLAYGROUND_URL = 'https://github.com/rust-lang/rust-playpen';
const REPO_URL = 'https://github.com/rust-lang/rust-playground';
const RUSTFMT_URL = 'https://github.com/rust-lang-nursery/rustfmt';
const SHEPMASTER_URL = 'https://github.com/shepmaster/';
const RUST_EDITION_2018_URL = 'https://doc.rust-lang.org/edition-guide/rust-2018/index.html';

const CRATE_EXAMPLE = `extern crate rand;
use rand::Rng;
const CRATE_EXAMPLE = `use rand::Rng;
fn main() {
let mut rng = rand::thread_rng();
Expand Down Expand Up @@ -115,7 +115,10 @@ const Help: React.FC = () => {
the <a href={RUST_COOKBOOK_URL}>Rust Cookbook</a>, and all
of their dependencies. To use a crate, add the appropriate
{' '}
<Code>extern crate foo</Code> line to the code.
<Code>extern crate foo</Code> line to the code, or, since
<a href={RUST_EDITION_2018_URL}>Rust Edition 2018</a>, just
{' '}
<Code>use</Code> any item from that crate.
</p>

<Example code={CRATE_EXAMPLE} />
Expand Down

0 comments on commit 53554db

Please sign in to comment.