Skip to content

Commit

Permalink
Removed unnecessary comments and white spaces as suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
reedlepee123 committed Oct 22, 2013
1 parent ad46544 commit 92662a9
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 66 deletions.
1 change: 0 additions & 1 deletion src/libextra/arc.rs
Expand Up @@ -521,7 +521,6 @@ fn borrow_rwlock<T:Freeze + Send>(state: *mut RWArcInner<T>) -> *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,
Expand Down
1 change: 0 additions & 1 deletion src/libextra/comm.rs
Expand Up @@ -91,7 +91,6 @@ pub fn DuplexStream<T:Send,U:Send>()
}

/// An extension of `pipes::stream` that provides synchronous message sending.
// all were already priv
pub struct SyncChan<T> { priv duplex_stream: DuplexStream<T, ()> }
/// An extension of `pipes::stream` that acknowledges each message received.
pub struct SyncPort<T> { priv duplex_stream: DuplexStream<(), T> }
Expand Down
4 changes: 2 additions & 2 deletions src/libextra/ebml.rs
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/libextra/fileinput.rs
Expand Up @@ -109,9 +109,9 @@ file is `stdin`.
*/
#[deriving(Clone)]
pub struct FileInputState {
priv current_path: Option<Path>,
priv line_num: uint,
priv line_num_file: uint
current_path: Option<Path>,
line_num: uint,
line_num_file: uint
}

impl FileInputState {
Expand Down
6 changes: 2 additions & 4 deletions src/libextra/getopts.rs
Expand Up @@ -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],
Expand All @@ -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]
}

Expand Down
4 changes: 2 additions & 2 deletions src/libextra/num/complex.rs
Expand Up @@ -25,9 +25,9 @@ use std::num::{Zero,One,ToStrRadix};
#[deriving(Eq,Clone)]
pub struct Cmplx<T> {
/// 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<f32>;
Expand Down
3 changes: 0 additions & 3 deletions src/libextra/sync.rs
Expand Up @@ -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]>,
Expand Down Expand Up @@ -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 }
Expand Down
1 change: 0 additions & 1 deletion src/libextra/term.rs
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/libstd/fmt/mod.rs
Expand Up @@ -478,20 +478,18 @@ 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
align: parse::Alignment,
/// Optionally specified integer width that the output should be
width: Option<uint>,
/// Optionally specified precision for numeric types
precision: Option<uint>,
precision: Option<uint>,

/// Output buffer.
buf: &'self mut io::Writer,

// already priv
priv curarg: vec::VecIterator<'self, Argument<'self>>,
priv args: &'self [Argument<'self>],
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/fmt/rt.rs
Expand Up @@ -38,7 +38,7 @@ pub struct FormatSpec {
fill: char,
align: parse::Alignment,
flags: uint,
precision: Count,
precision: Count,
width: Count,
}

Expand Down
6 changes: 3 additions & 3 deletions src/libstd/io.rs
Expand Up @@ -1815,9 +1815,9 @@ pub mod fsync {
}

pub struct Arg<t> {
priv val: t,
priv opt_level: Option<Level>,
priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
priv val: t,
priv opt_level: Option<Level>,
priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
}

// fsync file after executing blk
Expand Down
28 changes: 1 addition & 27 deletions src/libstd/iter.rs
Expand Up @@ -792,7 +792,6 @@ impl<A, T: DoubleEndedIterator<A> + RandomAccessIterator<A>> RandomAccessIterato

/// A mutable reference to an iterator
pub struct ByRef<'self, T> {
// already priv
priv iter: &'self mut T
}

Expand Down Expand Up @@ -928,7 +927,6 @@ impl<A, T: Clone + Iterator<A>> ClonableIterator for T {
/// An iterator that repeats endlessly
#[deriving(Clone)]
pub struct Cycle<T> {
// already priv
priv orig: T,
priv iter: T,
}
Expand Down Expand Up @@ -980,7 +978,6 @@ impl<A, T: Clone + RandomAccessIterator<A>> RandomAccessIterator<A> for Cycle<T>
/// An iterator which strings two iterators together
#[deriving(Clone)]
pub struct Chain<T, U> {
// already priv
priv a: T,
priv b: U,
priv flag: bool
Expand Down Expand Up @@ -1050,7 +1047,6 @@ for Chain<T, U> {
/// An iterator which iterates two other iterators simultaneously
#[deriving(Clone)]
pub struct Zip<T, U> {
// already priv
priv a: T,
priv b: U
}
Expand Down Expand Up @@ -1129,7 +1125,6 @@ RandomAccessIterator<(A, B)> for Zip<T, U> {

/// 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
}
Expand Down Expand Up @@ -1179,7 +1174,6 @@ impl<'self, A, B, T: RandomAccessIterator<A>> RandomAccessIterator<B> 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
}
Expand Down Expand Up @@ -1224,7 +1218,6 @@ impl<'self, A, T: DoubleEndedIterator<A>> DoubleEndedIterator<A> 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<B>
}
Expand Down Expand Up @@ -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<T> {
// already priv
priv iter: T,
priv count: uint
}
Expand Down Expand Up @@ -1324,7 +1316,6 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<(uint, A)> for Enumerat

/// An iterator with a `peek()` that returns an optional reference to the next element.
pub struct Peekable<A, T> {
// already priv
priv iter: T,
priv peeked: Option<A>,
}
Expand Down Expand Up @@ -1369,7 +1360,6 @@ impl<'self, A, T: Iterator<A>> Peekable<A, T> {

/// 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
Expand Down Expand Up @@ -1408,7 +1398,6 @@ impl<'self, A, T: Iterator<A>> Iterator<A> 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
Expand Down Expand Up @@ -1444,7 +1433,6 @@ impl<'self, A, T: Iterator<A>> Iterator<A> for TakeWhile<'self, A, T> {
/// An iterator which skips over `n` elements of `iter`.
#[deriving(Clone)]
pub struct Skip<T> {
// already priv
priv iter: T,
priv n: uint
}
Expand Down Expand Up @@ -1509,7 +1497,6 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Skip<T> {
/// An iterator which only iterates over the first `n` iterations of `iter`.
#[deriving(Clone)]
pub struct Take<T> {
// already priv
priv iter: T,
priv n: uint
}
Expand Down Expand Up @@ -1559,13 +1546,11 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Take<T> {

/// 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<B>,

/// 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<A>, St> Iterator<B> for Scan<'self, A, B, T, St> {
Expand All @@ -1585,7 +1570,6 @@ impl<'self, A, B, T: Iterator<A>, St> Iterator<B> 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<U>,
Expand Down Expand Up @@ -1645,7 +1629,6 @@ impl<'self,
/// yields `None` once.
#[deriving(Clone, DeepClone)]
pub struct Fuse<T> {
// already priv
priv iter: T,
priv done: bool
}
Expand Down Expand Up @@ -1718,7 +1701,6 @@ impl<T> Fuse<T> {
/// 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)
}
Expand Down Expand Up @@ -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<A>,
/// Internal state that will be yielded on the next iteration
/// priv reedlepee
state: St
}

Expand Down Expand Up @@ -1809,7 +1789,6 @@ impl<'self, A, St> Iterator<A> for Unfold<'self, A, St> {
/// iteration
#[deriving(Clone)]
pub struct Counter<A> {
// 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
Expand Down Expand Up @@ -1839,7 +1818,6 @@ impl<A: Add<A, A> + Clone> Iterator<A> for Counter<A> {
/// An iterator over the range [start, stop)
#[deriving(Clone, DeepClone)]
pub struct Range<A> {
// already priv
priv state: A,
priv stop: A,
priv one: A
Expand Down Expand Up @@ -1884,7 +1862,6 @@ impl<A: Integer + Ord + Clone> DoubleEndedIterator<A> for Range<A> {
/// An iterator over the range [start, stop]
#[deriving(Clone, DeepClone)]
pub struct RangeInclusive<A> {
// already priv
priv range: Range<A>,
priv done: bool
}
Expand Down Expand Up @@ -1946,7 +1923,6 @@ impl<A: Sub<A, A> + Integer + Ord + Clone> DoubleEndedIterator<A> for RangeInclu
/// An iterator over the range [start, stop) by `step`. It handles overflow by stopping.
#[deriving(Clone, DeepClone)]
pub struct RangeStep<A> {
// already priv
priv state: A,
priv stop: A,
priv step: A,
Expand Down Expand Up @@ -1979,7 +1955,6 @@ impl<A: CheckedAdd + Ord + Clone> Iterator<A> for RangeStep<A> {
/// An iterator over the range [start, stop] by `step`. It handles overflow by stopping.
#[deriving(Clone, DeepClone)]
pub struct RangeStepInclusive<A> {
// already priv
priv state: A,
priv stop: A,
priv step: A,
Expand Down Expand Up @@ -2015,7 +1990,6 @@ impl<A: CheckedAdd + Ord + Clone + Eq> Iterator<A> for RangeStepInclusive<A> {
/// An iterator that repeats an element endlessly
#[deriving(Clone, DeepClone)]
pub struct Repeat<A> {
// already priv
priv element: A
}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/sched.rs
Expand Up @@ -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>],
Expand Down
26 changes: 13 additions & 13 deletions src/libstd/rt/task.rs
Expand Up @@ -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<Taskgroup>,
death: Death,
destroyed: bool,
name: Option<SendStr>,
coroutine: Option<Coroutine>,
sched: Option<~Scheduler>,
task_type: TaskType,
heap: LocalHeap,
priv gc: GarbageCollector,
storage: LocalStorage,
logger: StdErrLogger,
unwinder: Unwinder,
taskgroup: Option<Taskgroup>,
death: Death,
destroyed: bool,
name: Option<SendStr>,
coroutine: Option<Coroutine>,
sched: Option<~Scheduler>,
task_type: TaskType,
// Dynamic borrowck debugging info
borrow_list: Option<~[BorrowRecord]>
borrow_list: Option<~[BorrowRecord]>
}

pub enum TaskType {
Expand Down

0 comments on commit 92662a9

Please sign in to comment.