Explain that FileLines cannot be given in rustfmt.toml

This adds a note to both the `--config-help` output for `file_lines`,
and to the panic message on attempting to deserialize a `FileLines`
struct.
This commit is contained in:
Kamal Marhubi 2016-05-30 16:41:43 +02:00
parent 8775fe4172
commit 66483017f6
2 changed files with 4 additions and 2 deletions

@ -335,7 +335,8 @@ create_config! {
verbose: bool, false, "Use verbose output";
skip_children: bool, false, "Don't reformat out of line modules";
file_lines: FileLines, FileLines::all(),
"Lines to format";
"Lines to format; this is not supported in rustfmt.toml, and can only be specified \
via the --file-lines option";
max_width: usize, 100, "Maximum width of each line";
ideal_width: usize, 80, "Ideal width of each line";
tab_spaces: usize, 4, "Number of spaces per tab";

@ -181,7 +181,8 @@ impl JsonSpan {
// for `FileLines`, so it will just panic instead.
impl rustc_serialize::Decodable for FileLines {
fn decode<D: rustc_serialize::Decoder>(_: &mut D) -> Result<Self, D::Error> {
unimplemented!();
panic!("FileLines cannot be deserialized from a project rustfmt.toml file: please \
specify it via the `--file-lines` option instead");
}
}