Skip to content

Commit 2e0aa5f

Browse files
giraffatecalebcartwright
authored andcommitted
Fix broken links in Contributing.md
1 parent 81ad114 commit 2e0aa5f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Contributing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Rustfmt is basically a pretty printer - that is, its mode of operation is to
186186
take an AST (abstract syntax tree) and print it in a nice way (including staying
187187
under the maximum permitted width for a line). In order to get that AST, we
188188
first have to parse the source text, we use the Rust compiler's parser to do
189-
that (see [lib.rs in rustfmt-lib](rustfmt-core/rustfmt-lib/src/lib.rs)). We shy away from doing anything too fancy, such as
189+
that (see [lib.rs](src/lib.rs)). We shy away from doing anything too fancy, such as
190190
algebraic approaches to pretty printing, instead relying on an heuristic
191191
approach, 'manually' crafting a string for each AST node. This results in quite
192192
a lot of code, but it is relatively simple.
@@ -226,19 +226,19 @@ At a higher level, Rustfmt has machinery so that we account for text between
226226
'top level' items. Then we can reproduce that text pretty much verbatim. We only
227227
count spans we actually reformat, so if we can't format a span it is not missed
228228
completely but is reproduced in the output without being formatted. This is
229-
mostly handled in [missed_spans.rs](rustfmt-core/rustfmt-lib/src/missed_spans.rs). See also `FmtVisitor::last_pos` in
230-
[visitor.rs](rustfmt-core/rustfmt-lib/src/visitor.rs).
229+
mostly handled in [missed_spans.rs](src/formatting/missed_spans.rs). See also `FmtVisitor::last_pos` in
230+
[visitor.rs](src/formatting/visitor.rs).
231231

232232

233233
#### Some important elements
234234

235235
At the highest level, Rustfmt uses a `Visitor` implementation called `FmtVisitor`
236-
to walk the AST. This is in [visitor.rs](rustfmt-core/rustfmt-lib/src/visitor.rs). This is really just used to walk
236+
to walk the AST. This is in [visitor.rs](src/formatting/visitor.rs). This is really just used to walk
237237
items, rather than the bodies of functions. We also cover macros and attributes
238238
here. Most methods of the visitor call out to `Rewrite` implementations that
239239
then walk their own children.
240240

241-
The `Rewrite` trait is defined in [rewrite.rs](rustfmt-core/rustfmt-lib/src/rewrite.rs). It is implemented for many
241+
The `Rewrite` trait is defined in [rewrite.rs](src/formatting/rewrite.rs). It is implemented for many
242242
things that can be rewritten, mostly AST nodes. It has a single function,
243243
`rewrite`, which is called to rewrite `self` into an `Option<String>`. The
244244
arguments are `width` which is the horizontal space we write into and `offset`
@@ -296,15 +296,15 @@ Much of the syntax in Rust is lists: lists of arguments, lists of fields, lists
296296
array elements, etc. We have some generic code to handle lists, including how to
297297
space them in horizontal and vertical space, indentation, comments between
298298
items, trailing separators, etc. However, since there are so many options, the
299-
code is a bit complex. Look in [lists.rs](rustfmt-core/rustfmt-lib/src/lists.rs). `write_list` is the key function,
299+
code is a bit complex. Look in [lists.rs](src/formatting/lists.rs). `write_list` is the key function,
300300
and `ListFormatting` the key structure for configuration. You'll need to make a
301301
`ListItems` for input, this is usually done using `itemize_list`.
302302

303303
##### Configuration
304304

305305
Rustfmt strives to be highly configurable. Often the first part of a patch is
306306
creating a configuration option for the feature you are implementing. All
307-
handling of configuration options is done in [lib.rs in rustfmt-config](rustfmt-core/rustfmt-config/src/lib.rs). Look for the
307+
handling of configuration options is done in [config.rs](src/config.rs). Look for the
308308
`create_config!` macro at the end of the file for all the options. The rest of
309309
the file defines a bunch of enums used for options, and the machinery to produce
310310
the config struct and parse a config file, etc. Checking an option is done by

0 commit comments

Comments
 (0)