Skip to content

Instantly share code, notes, and snippets.

@yaymukund
Last active August 25, 2018 16:53
Show Gist options
  • Save yaymukund/b1735f8a918400a1aa7545935cbee7c0 to your computer and use it in GitHub Desktop.
Save yaymukund/b1735f8a918400a1aa7545935cbee7c0 to your computer and use it in GitHub Desktop.
help!
  1. Is there some way to use HttpClient in Downloader without making it public?
  2. Is super::... the right way to do this?
// downloader/downloader.rs
use super::http_client::HttpClient;
pub struct Downloader {
    client: HttpClient;
}

// downloader/http_client.rs
pub struct HttpClient {}

// downloader/mod.rs
mod http_client;
mod downloader;
pub use downloader::Downloader;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment