Make some more stuff private
0.6
This commit is contained in:
parent
ca610d35b3
commit
866900449a
3 changed files with 11 additions and 7 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -451,7 +451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "rustfmt-nightly"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"assert_cli 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
|
||||
name = "rustfmt-nightly"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
authors = ["Nicholas Cameron <ncameron@mozilla.com>", "The Rustfmt developers"]
|
||||
description = "Tool to find and fix Rust formatting issues"
|
||||
repository = "https://github.com/rust-lang-nursery/rustfmt"
|
||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -39,7 +39,7 @@ extern crate unicode_segmentation;
|
|||
use std::collections::HashMap;
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
use std::io::{self, stdout, BufRead, Write};
|
||||
use std::io::{self, stdout, Write};
|
||||
use std::panic::{catch_unwind, AssertUnwindSafe};
|
||||
use std::path::PathBuf;
|
||||
use std::rc::Rc;
|
||||
|
@ -819,7 +819,7 @@ fn format_input_inner<T: Write>(
|
|||
/// A single span of changed lines, with 0 or more removed lines
|
||||
/// and a vector of 0 or more inserted lines.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub struct ModifiedChunk {
|
||||
struct ModifiedChunk {
|
||||
/// The first to be removed from the original text
|
||||
pub line_number_orig: u32,
|
||||
/// The number of lines which have been replaced
|
||||
|
@ -830,13 +830,14 @@ pub struct ModifiedChunk {
|
|||
|
||||
/// Set of changed sections of a file.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub struct ModifiedLines {
|
||||
struct ModifiedLines {
|
||||
/// The set of changed chunks.
|
||||
pub chunks: Vec<ModifiedChunk>,
|
||||
}
|
||||
|
||||
/// The successful result of formatting via `get_modified_lines()`.
|
||||
pub struct ModifiedLinesResult {
|
||||
#[cfg(test)]
|
||||
struct ModifiedLinesResult {
|
||||
/// The high level summary details
|
||||
pub summary: Summary,
|
||||
/// The result Filemap
|
||||
|
@ -849,10 +850,13 @@ pub struct ModifiedLinesResult {
|
|||
|
||||
/// Format a file and return a `ModifiedLines` data structure describing
|
||||
/// the changed ranges of lines.
|
||||
pub fn get_modified_lines(
|
||||
#[cfg(test)]
|
||||
fn get_modified_lines(
|
||||
input: Input,
|
||||
config: &Config,
|
||||
) -> Result<ModifiedLinesResult, (io::Error, Summary)> {
|
||||
use std::io::BufRead;
|
||||
|
||||
let mut data = Vec::new();
|
||||
|
||||
let mut config = config.clone();
|
||||
|
|
Loading…
Reference in a new issue