Skip to content

Make fields in std::comm private #9935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/libstd/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ pub trait Peekable<T> {
fn peek(&self) -> bool;
}

pub struct PortOne<T> { x: rtcomm::PortOne<T> }
pub struct ChanOne<T> { x: rtcomm::ChanOne<T> }
pub struct PortOne<T> { priv x: rtcomm::PortOne<T> }
pub struct ChanOne<T> { priv x: rtcomm::ChanOne<T> }

pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) {
let (p, c) = rtcomm::oneshot();
(PortOne { x: p }, ChanOne { x: c })
}

pub struct Port<T> { x: rtcomm::Port<T> }
pub struct Chan<T> { x: rtcomm::Chan<T> }
pub struct Port<T> { priv x: rtcomm::Port<T> }
pub struct Chan<T> { priv x: rtcomm::Chan<T> }

pub fn stream<T: Send>() -> (Port<T>, Chan<T>) {
let (p, c) = rtcomm::stream();
Expand Down Expand Up @@ -153,7 +153,7 @@ impl<T: Send> Peekable<T> for Port<T> {
}


pub struct SharedChan<T> { x: rtcomm::SharedChan<T> }
pub struct SharedChan<T> { priv x: rtcomm::SharedChan<T> }

impl<T: Send> SharedChan<T> {
pub fn new(c: Chan<T>) -> SharedChan<T> {
Expand Down Expand Up @@ -195,7 +195,7 @@ impl<T> Clone for SharedChan<T> {
}
}

pub struct SharedPort<T> { x: rtcomm::SharedPort<T> }
pub struct SharedPort<T> { priv x: rtcomm::SharedPort<T> }

impl<T: Send> SharedPort<T> {
pub fn new(p: Port<T>) -> SharedPort<T> {
Expand Down