@@ -75,13 +75,13 @@ fn main() {
7575 println!("{}", a_loop());
7676}` ;
7777
78- const Help : React . SFC = ( ) => {
78+ const Help : React . FC = ( ) => {
7979 return (
8080 < section className = { styles . container } >
8181 < h1 > The Rust Playground</ h1 >
8282 < Link action = { actions . navigateToIndex } > Return to the playground</ Link >
8383
84- < LinkableSection id = "about" header = "About" level = { H2 } >
84+ < LinkableSection id = "about" header = "About" level = "h2" >
8585 < p >
8686 The playground is an < a href = { REPO_URL } > open source project</ a > .
8787 If you have any suggestions for features, issues with the
@@ -107,8 +107,8 @@ const Help: React.SFC = () => {
107107 </ p >
108108 </ LinkableSection >
109109
110- < LinkableSection id = "features" header = "Features" level = { H2 } >
111- < LinkableSection id = "features-crates" header = "Crates" level = { H3 } >
110+ < LinkableSection id = "features" header = "Features" level = "h2" >
111+ < LinkableSection id = "features-crates" header = "Crates" level = "h3" >
112112 < p >
113113 The playground provides the top 100 most downloaded crates
114114 from < a href = { CRATES_IO_URL } > crates.io</ a > , the crates from
@@ -126,7 +126,7 @@ const Help: React.SFC = () => {
126126 </ p >
127127 </ LinkableSection >
128128
129- < LinkableSection id = "features-formatting" header = "Formatting code" level = { H3 } >
129+ < LinkableSection id = "features-formatting" header = "Formatting code" level = "h3" >
130130 < p >
131131 < a href = { RUSTFMT_URL } > rustfmt</ a > is a tool for formatting Rust code
132132 according to the Rust style guidelines. Click on the < strong > Format</ strong >
@@ -137,7 +137,7 @@ const Help: React.SFC = () => {
137137 < Example code = { RUSTFMT_EXAMPLE } />
138138 </ LinkableSection >
139139
140- < LinkableSection id = "features-linting" header = "Linting code" level = { H3 } >
140+ < LinkableSection id = "features-linting" header = "Linting code" level = "h3" >
141141 < p >
142142 < a href = { CLIPPY_URL } > Clippy</ a > is a collection of lints to catch common
143143 mistakes and improve your Rust code. Click on the < strong > Clippy</ strong >
@@ -149,7 +149,7 @@ const Help: React.SFC = () => {
149149 < Example code = { CLIPPY_EXAMPLE } />
150150 </ LinkableSection >
151151
152- < LinkableSection id = "features-miri" header = "Checking code for undefined behavior" level = { H3 } >
152+ < LinkableSection id = "features-miri" header = "Checking code for undefined behavior" level = "h3" >
153153 < p >
154154 < a href = { MIRI_URL } > Miri</ a > is an interpreter for Rust’s mid-level intermediate
155155 representation (MIR) and can be used to detect certain kinds of undefined behavior
@@ -160,7 +160,7 @@ const Help: React.SFC = () => {
160160 < Example code = { MIRI_EXAMPLE } />
161161 </ LinkableSection >
162162
163- < LinkableSection id = "features-sharing" header = "Sharing code" level = { H3 } >
163+ < LinkableSection id = "features-sharing" header = "Sharing code" level = "h3" >
164164 < p >
165165 Once you have some code worth saving or sharing, click on the
166166 { ' ' }
@@ -171,7 +171,7 @@ const Help: React.SFC = () => {
171171 </ p >
172172 </ LinkableSection >
173173
174- < LinkableSection id = "features-linking" header = "Linking to the playground with initial code" level = { H3 } >
174+ < LinkableSection id = "features-linking" header = "Linking to the playground with initial code" level = "h3" >
175175 < p >
176176 If you have a web page with Rust code that you’d like to
177177 show in action, you can link to the playground with the
@@ -183,7 +183,7 @@ const Help: React.SFC = () => {
183183 < pre className = { styles . code } > < code > { LINK_EXAMPLE } </ code > </ pre >
184184 </ LinkableSection >
185185
186- < LinkableSection id = "features-tests" header = "Executing tests" level = { H3 } >
186+ < LinkableSection id = "features-tests" header = "Executing tests" level = "h3" >
187187 < p >
188188 If your code contains the < Code > #[test]</ Code > attribute and does not
189189 contain a < Code > main</ Code > method, < Code > cargo test</ Code > will be
@@ -193,7 +193,7 @@ const Help: React.SFC = () => {
193193 < Example code = { TEST_EXAMPLE } />
194194 </ LinkableSection >
195195
196- < LinkableSection id = "features-library" header = "Compiling as a library" level = { H3 } >
196+ < LinkableSection id = "features-library" header = "Compiling as a library" level = "h3" >
197197 < p >
198198 If your code contains the < Code > #![crate_type="lib"]</ Code > attribute,
199199 { ' ' }
@@ -204,7 +204,7 @@ const Help: React.SFC = () => {
204204 < Example code = { LIBRARY_EXAMPLE } />
205205 </ LinkableSection >
206206
207- < LinkableSection id = "features-output-formats" header = "Output formats" level = { H3 } >
207+ < LinkableSection id = "features-output-formats" header = "Output formats" level = "h3" >
208208 < p >
209209 Instead of executing the code, you can also see intermediate
210210 output of the compiler as x86_64 assembly, LLVM IR, Rust MIR, or
@@ -217,7 +217,7 @@ const Help: React.SFC = () => {
217217 < Example code = { OUTPUT_EXAMPLE } />
218218 </ LinkableSection >
219219
220- < LinkableSection id = "features-modes" header = "Compilation modes" level = { H3 } >
220+ < LinkableSection id = "features-modes" header = "Compilation modes" level = "h3" >
221221 < p >
222222 Rust has two primary compilation modes: < strong > Debug</ strong > and
223223 { ' ' }
@@ -232,7 +232,7 @@ const Help: React.SFC = () => {
232232 </ p >
233233 </ LinkableSection >
234234
235- < LinkableSection id = "features-channels" header = "Rust channels" level = { H3 } >
235+ < LinkableSection id = "features-channels" header = "Rust channels" level = "h3" >
236236 < p >
237237 Rust releases new < strong > stable</ strong > versions every 6
238238 weeks. Between these stable releases, < strong > beta</ strong > versions of the
@@ -247,7 +247,7 @@ const Help: React.SFC = () => {
247247 </ p >
248248 </ LinkableSection >
249249
250- < LinkableSection id = "features-customization" header = "Customization" level = { H3 } >
250+ < LinkableSection id = "features-customization" header = "Customization" level = "h3" >
251251 < p >
252252 The < a href = { ACE_URL } > Ajax.org Cloud9 Editor (Ace)</ a > is used to
253253 provide a better interface for editing code. Ace comes with
@@ -265,7 +265,7 @@ const Help: React.SFC = () => {
265265 </ p >
266266 </ LinkableSection >
267267
268- < LinkableSection id = "features-persistence" header = "Persistence" level = { H3 } >
268+ < LinkableSection id = "features-persistence" header = "Persistence" level = "h3" >
269269 < p >
270270 The most recently entered code will be automatically saved in your browser’s
271271 { ' ' }
@@ -280,7 +280,7 @@ const Help: React.SFC = () => {
280280 </ LinkableSection >
281281 </ LinkableSection >
282282
283- < LinkableSection id = "limitations" header = "Limitations" level = { H2 } >
283+ < LinkableSection id = "limitations" header = "Limitations" level = "h2" >
284284 < p >
285285 To prevent the playground from being used to attack other computers and
286286 to ensure it is available for everyone to use, some limitations
@@ -316,10 +316,7 @@ const Help: React.SFC = () => {
316316 ) ;
317317} ;
318318
319- const H2 : React . SFC = ( { children } ) => < h2 > { children } </ h2 > ;
320- const H3 : React . SFC = ( { children } ) => < h3 > { children } </ h3 > ;
321-
322- const LinkableSection : React . SFC < LinkableSectionProps > = ( {
319+ const LinkableSection : React . FC < LinkableSectionProps > = ( {
323320 id, header, level : Level , children,
324321} ) => (
325322 < div id = { id } >
@@ -335,10 +332,10 @@ const LinkableSection: React.SFC<LinkableSectionProps> = ({
335332interface LinkableSectionProps {
336333 id : string ;
337334 header : string ;
338- level : ( ChildrenProps ) => JSX . Element ;
335+ level : React . ElementType ;
339336}
340337
341- const Code : React . SFC = ( { children } ) => (
338+ const Code : React . FC = ( { children } ) => (
342339 < code className = { styles . code } > { children } </ code >
343340) ;
344341
0 commit comments