From 92662a9f9101c702215a6160eb3af0aabc583423 Mon Sep 17 00:00:00 2001 From: reedlepee Date: Sun, 20 Oct 2013 11:21:30 +0530 Subject: [PATCH] Removed unnecessary comments and white spaces as suggested --- src/libextra/arc.rs | 1 - src/libextra/comm.rs | 1 - src/libextra/ebml.rs | 4 ++-- src/libextra/fileinput.rs | 6 +++--- src/libextra/getopts.rs | 6 ++---- src/libextra/num/complex.rs | 4 ++-- src/libextra/sync.rs | 3 --- src/libextra/term.rs | 1 - src/libstd/fmt/mod.rs | 6 ++---- src/libstd/fmt/rt.rs | 2 +- src/libstd/io.rs | 6 +++--- src/libstd/iter.rs | 28 +--------------------------- src/libstd/rt/sched.rs | 2 +- src/libstd/rt/task.rs | 26 +++++++++++++------------- 14 files changed, 30 insertions(+), 66 deletions(-) diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs index 2e394014c33b7..1ce52d1d2784a 100644 --- a/src/libextra/arc.rs +++ b/src/libextra/arc.rs @@ -521,7 +521,6 @@ fn borrow_rwlock(state: *mut RWArcInner) -> *RWLock { /// The "write permission" token used for RWArc.write_downgrade(). pub struct RWWriteMode<'self, T> { - priv data: &'self mut T, priv token: sync::RWLockWriteMode<'self>, priv poison: PoisonOnFail, diff --git a/src/libextra/comm.rs b/src/libextra/comm.rs index a31f27a288589..4a3801827a211 100644 --- a/src/libextra/comm.rs +++ b/src/libextra/comm.rs @@ -91,7 +91,6 @@ pub fn DuplexStream() } /// An extension of `pipes::stream` that provides synchronous message sending. -// all were already priv pub struct SyncChan { priv duplex_stream: DuplexStream } /// An extension of `pipes::stream` that acknowledges each message received. pub struct SyncPort { priv duplex_stream: DuplexStream<(), T> } diff --git a/src/libextra/ebml.rs b/src/libextra/ebml.rs index 3612b256f1b37..34515a2b955cb 100644 --- a/src/libextra/ebml.rs +++ b/src/libextra/ebml.rs @@ -618,8 +618,8 @@ pub mod writer { // ebml writing pub struct Encoder { - writer: @io::Writer, - priv size_positions: ~[uint], + writer: @io::Writer, + priv size_positions: ~[uint], } impl Clone for Encoder { diff --git a/src/libextra/fileinput.rs b/src/libextra/fileinput.rs index 112babf271bc8..49072dab6d025 100644 --- a/src/libextra/fileinput.rs +++ b/src/libextra/fileinput.rs @@ -109,9 +109,9 @@ file is `stdin`. */ #[deriving(Clone)] pub struct FileInputState { - priv current_path: Option, - priv line_num: uint, - priv line_num_file: uint + current_path: Option, + line_num: uint, + line_num_file: uint } impl FileInputState { diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index 3663b5c8d0842..38b4d83fe0be4 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -114,9 +114,9 @@ pub enum Occur { pub struct Opt { /// Name of the option name: Name, - /// Wheter it has an argument... should be public!! + /// Wheter it has an argument hasarg: HasArg, - /// How often it can occur... should be private !! + /// How often it can occur occur: Occur, /// Which options it aliases priv aliases: ~[Opt], @@ -133,13 +133,11 @@ enum Optval { /// of matches and a vector of free strings. #[deriving(Clone, Eq)] pub struct Matches { - /// Options that matched priv opts: ~[Opt], /// Values of the Options that matched priv vals: ~[~[Optval]], /// Free string fragments - // public free: ~[~str] } diff --git a/src/libextra/num/complex.rs b/src/libextra/num/complex.rs index 021a069fbbe73..58af80fefb787 100644 --- a/src/libextra/num/complex.rs +++ b/src/libextra/num/complex.rs @@ -25,9 +25,9 @@ use std::num::{Zero,One,ToStrRadix}; #[deriving(Eq,Clone)] pub struct Cmplx { /// Real portion of the complex number - priv re: T, + re: T, /// Imaginary portion of the complex number - priv im: T + im: T } pub type Complex32 = Cmplx; diff --git a/src/libextra/sync.rs b/src/libextra/sync.rs index 9a53fd639c513..131cf063d1d35 100644 --- a/src/libextra/sync.rs +++ b/src/libextra/sync.rs @@ -167,8 +167,6 @@ enum ReacquireOrderLock<'self> { /// A mechanism for atomic-unlock-and-deschedule blocking and signalling. pub struct Condvar<'self> { - - // The 'Sem' object associated with this condvar. This is the one that's // atomically-unlocked-and-descheduled upon and reacquired during wakeup. priv sem: &'self Sem<~[WaitQueue]>, @@ -667,7 +665,6 @@ impl RWLock { /// The "write permission" token used for rwlock.write_downgrade(). pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable } - /// The "read permission" token used for rwlock.write_downgrade(). pub struct RWLockReadMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable } diff --git a/src/libextra/term.rs b/src/libextra/term.rs index 6bef136f41498..878224890e619 100644 --- a/src/libextra/term.rs +++ b/src/libextra/term.rs @@ -95,7 +95,6 @@ fn cap_for_attr(attr: attr::Attr) -> &'static str { #[cfg(not(target_os = "win32"))] pub struct Terminal { - priv num_colors: u16, priv out: @io::Writer, priv ti: ~TermInfo diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index e5188d737bdfe..9d5c9c1a5cd66 100644 --- a/src/libstd/fmt/mod.rs +++ b/src/libstd/fmt/mod.rs @@ -478,7 +478,7 @@ pub mod rt; /// traits. pub struct Formatter<'self> { /// Flags for formatting (packed version of rt::Flag) - flags: uint, + flags: uint, /// Character used as 'fill' whenever there is alignment fill: char, /// Boolean indication of whether the output should be left-aligned @@ -486,12 +486,10 @@ pub struct Formatter<'self> { /// Optionally specified integer width that the output should be width: Option, /// Optionally specified precision for numeric types - precision: Option, + precision: Option, /// Output buffer. buf: &'self mut io::Writer, - - // already priv priv curarg: vec::VecIterator<'self, Argument<'self>>, priv args: &'self [Argument<'self>], } diff --git a/src/libstd/fmt/rt.rs b/src/libstd/fmt/rt.rs index d9a7557e55312..b20af1a35b8c7 100644 --- a/src/libstd/fmt/rt.rs +++ b/src/libstd/fmt/rt.rs @@ -38,7 +38,7 @@ pub struct FormatSpec { fill: char, align: parse::Alignment, flags: uint, - precision: Count, + precision: Count, width: Count, } diff --git a/src/libstd/io.rs b/src/libstd/io.rs index 922150cb279f5..4e55c5fe60eb5 100644 --- a/src/libstd/io.rs +++ b/src/libstd/io.rs @@ -1815,9 +1815,9 @@ pub mod fsync { } pub struct Arg { - priv val: t, - priv opt_level: Option, - priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int, + priv val: t, + priv opt_level: Option, + priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int, } // fsync file after executing blk diff --git a/src/libstd/iter.rs b/src/libstd/iter.rs index e854d338f547b..771be3b2a134f 100644 --- a/src/libstd/iter.rs +++ b/src/libstd/iter.rs @@ -792,7 +792,6 @@ impl + RandomAccessIterator> RandomAccessIterato /// A mutable reference to an iterator pub struct ByRef<'self, T> { - // already priv priv iter: &'self mut T } @@ -928,7 +927,6 @@ impl> ClonableIterator for T { /// An iterator that repeats endlessly #[deriving(Clone)] pub struct Cycle { - // already priv priv orig: T, priv iter: T, } @@ -980,7 +978,6 @@ impl> RandomAccessIterator for Cycle /// An iterator which strings two iterators together #[deriving(Clone)] pub struct Chain { - // already priv priv a: T, priv b: U, priv flag: bool @@ -1050,7 +1047,6 @@ for Chain { /// An iterator which iterates two other iterators simultaneously #[deriving(Clone)] pub struct Zip { - // already priv priv a: T, priv b: U } @@ -1129,7 +1125,6 @@ RandomAccessIterator<(A, B)> for Zip { /// An iterator which maps the values of `iter` with `f` pub struct Map<'self, A, B, T> { - // already priv priv iter: T, priv f: &'self fn(A) -> B } @@ -1179,7 +1174,6 @@ impl<'self, A, B, T: RandomAccessIterator> RandomAccessIterator for Map<'s /// An iterator which filters the elements of `iter` with `predicate` pub struct Filter<'self, A, T> { - // already priv priv iter: T, priv predicate: &'self fn(&A) -> bool } @@ -1224,7 +1218,6 @@ impl<'self, A, T: DoubleEndedIterator> DoubleEndedIterator for Filter<'sel /// An iterator which uses `f` to both filter and map elements from `iter` pub struct FilterMap<'self, A, B, T> { - // already priv priv iter: T, priv f: &'self fn(A) -> Option } @@ -1269,7 +1262,6 @@ for FilterMap<'self, A, B, T> { /// An iterator which yields the current count and the element during iteration #[deriving(Clone)] pub struct Enumerate { - // already priv priv iter: T, priv count: uint } @@ -1324,7 +1316,6 @@ impl> RandomAccessIterator<(uint, A)> for Enumerat /// An iterator with a `peek()` that returns an optional reference to the next element. pub struct Peekable { - // already priv priv iter: T, priv peeked: Option, } @@ -1369,7 +1360,6 @@ impl<'self, A, T: Iterator> Peekable { /// An iterator which rejects elements while `predicate` is true pub struct SkipWhile<'self, A, T> { - // already priv priv iter: T, priv flag: bool, priv predicate: &'self fn(&A) -> bool @@ -1408,7 +1398,6 @@ impl<'self, A, T: Iterator> Iterator for SkipWhile<'self, A, T> { /// An iterator which only accepts elements while `predicate` is true pub struct TakeWhile<'self, A, T> { - // already priv priv iter: T, priv flag: bool, priv predicate: &'self fn(&A) -> bool @@ -1444,7 +1433,6 @@ impl<'self, A, T: Iterator> Iterator for TakeWhile<'self, A, T> { /// An iterator which skips over `n` elements of `iter`. #[deriving(Clone)] pub struct Skip { - // already priv priv iter: T, priv n: uint } @@ -1509,7 +1497,6 @@ impl> RandomAccessIterator for Skip { /// An iterator which only iterates over the first `n` iterations of `iter`. #[deriving(Clone)] pub struct Take { - // already priv priv iter: T, priv n: uint } @@ -1559,13 +1546,11 @@ impl> RandomAccessIterator for Take { /// An iterator to maintain state while iterating another iterator pub struct Scan<'self, A, B, T, St> { - // already priv priv iter: T, priv f: &'self fn(&mut St, A) -> Option, /// The current internal state to be passed to the closure next. - // priv by reedlepee - priv state: St + state: St } impl<'self, A, B, T: Iterator, St> Iterator for Scan<'self, A, B, T, St> { @@ -1585,7 +1570,6 @@ impl<'self, A, B, T: Iterator, St> Iterator for Scan<'self, A, B, T, St> { /// and yields the elements of the produced iterators /// pub struct FlatMap<'self, A, T, U> { - // already priv priv iter: T, priv f: &'self fn(A) -> U, priv frontiter: Option, @@ -1645,7 +1629,6 @@ impl<'self, /// yields `None` once. #[deriving(Clone, DeepClone)] pub struct Fuse { - // already priv priv iter: T, priv done: bool } @@ -1718,7 +1701,6 @@ impl Fuse { /// An iterator that calls a function with a reference to each /// element before yielding it. pub struct Inspect<'self, A, T> { - // already priv priv iter: T, priv f: &'self fn(&A) } @@ -1772,10 +1754,8 @@ for Inspect<'self, A, T> { /// An iterator which just modifies the contained state throughout iteration. pub struct Unfold<'self, A, St> { - // already priv priv f: &'self fn(&mut St) -> Option, /// Internal state that will be yielded on the next iteration - /// priv reedlepee state: St } @@ -1809,7 +1789,6 @@ impl<'self, A, St> Iterator for Unfold<'self, A, St> { /// iteration #[deriving(Clone)] pub struct Counter { - // by reedlepee /// The current state the counter is at (next value to be yielded) priv state: A, /// The amount that this iterator is stepping by @@ -1839,7 +1818,6 @@ impl + Clone> Iterator for Counter { /// An iterator over the range [start, stop) #[deriving(Clone, DeepClone)] pub struct Range { - // already priv priv state: A, priv stop: A, priv one: A @@ -1884,7 +1862,6 @@ impl DoubleEndedIterator for Range { /// An iterator over the range [start, stop] #[deriving(Clone, DeepClone)] pub struct RangeInclusive { - // already priv priv range: Range, priv done: bool } @@ -1946,7 +1923,6 @@ impl + Integer + Ord + Clone> DoubleEndedIterator for RangeInclu /// An iterator over the range [start, stop) by `step`. It handles overflow by stopping. #[deriving(Clone, DeepClone)] pub struct RangeStep { - // already priv priv state: A, priv stop: A, priv step: A, @@ -1979,7 +1955,6 @@ impl Iterator for RangeStep { /// An iterator over the range [start, stop] by `step`. It handles overflow by stopping. #[deriving(Clone, DeepClone)] pub struct RangeStepInclusive { - // already priv priv state: A, priv stop: A, priv step: A, @@ -2015,7 +1990,6 @@ impl Iterator for RangeStepInclusive { /// An iterator that repeats an element endlessly #[deriving(Clone, DeepClone)] pub struct Repeat { - // already priv priv element: A } diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index d157301533c42..48cd79875079d 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -40,7 +40,7 @@ use vec::{OwnedVector}; /// in too much allocation and too many events. pub struct Scheduler { /// There are N work queues, one per scheduler. - work_queue: WorkQueue<~Task>, + priv work_queue: WorkQueue<~Task>, /// Work queues for the other schedulers. These are created by /// cloning the core work queues. work_queues: ~[WorkQueue<~Task>], diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index ca96ee032e263..c4f352501a08b 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -43,20 +43,20 @@ use send_str::SendStr; // the type-specific state. pub struct Task { - heap: LocalHeap, - priv gc: GarbageCollector, - storage: LocalStorage, - logger: StdErrLogger, - unwinder: Unwinder, - taskgroup: Option, - death: Death, - destroyed: bool, - name: Option, - coroutine: Option, - sched: Option<~Scheduler>, - task_type: TaskType, + heap: LocalHeap, + priv gc: GarbageCollector, + storage: LocalStorage, + logger: StdErrLogger, + unwinder: Unwinder, + taskgroup: Option, + death: Death, + destroyed: bool, + name: Option, + coroutine: Option, + sched: Option<~Scheduler>, + task_type: TaskType, // Dynamic borrowck debugging info - borrow_list: Option<~[BorrowRecord]> + borrow_list: Option<~[BorrowRecord]> } pub enum TaskType {