Skip to content

Commit 569875b

Browse files
committed
remove pub where possible
1 parent 087f7a1 commit 569875b

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

src/db/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn get_file_list_from_dir<P: AsRef<Path>>(path: P,
4242
}
4343

4444

45-
pub fn get_file_list<P: AsRef<Path>>(path: P) -> Result<Vec<PathBuf>> {
45+
fn get_file_list<P: AsRef<Path>>(path: P) -> Result<Vec<PathBuf>> {
4646
let path = path.as_ref();
4747
let mut files = Vec::new();
4848

src/docbuilder/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub struct Metadata {
5353
/// System dependencies.
5454
///
5555
/// Docs.rs is running on a Debian jessie.
56-
pub dependencies: Option<Vec<String>>,
56+
dependencies: Option<Vec<String>>,
5757
}
5858

5959

@@ -69,7 +69,7 @@ impl Metadata {
6969
Err(err_msg("Manifest not found"))
7070
}
7171

72-
pub fn from_manifest<P: AsRef<Path>>(path: P) -> Metadata {
72+
fn from_manifest<P: AsRef<Path>>(path: P) -> Metadata {
7373
use std::fs::File;
7474
use std::io::Read;
7575
let mut f = match File::open(path) {

src/utils/github_updater.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use failure::err_msg;
99
/// Fields we need use in cratesfyi
1010
#[derive(Debug)]
1111
struct GitHubFields {
12-
pub description: String,
13-
pub stars: i64,
14-
pub forks: i64,
15-
pub issues: i64,
16-
pub last_commit: time::Timespec,
12+
description: String,
13+
stars: i64,
14+
forks: i64,
15+
issues: i64,
16+
last_commit: time::Timespec,
1717
}
1818

1919

src/web/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Web interface of cratesfyi
22
33

4-
pub mod page;
4+
pub(crate) mod page;
55

66
/// ctry! (cratesfyitry) is extremely similar to try! and itry!
77
/// except it returns an error page response instead of plain Err.
@@ -45,7 +45,7 @@ mod builds;
4545
mod error;
4646
mod sitemap;
4747
mod routes;
48-
pub mod metrics;
48+
pub(crate) mod metrics;
4949

5050
use std::{env, fmt};
5151
use std::error::Error;
@@ -105,7 +105,7 @@ impl CratesfyiHandler {
105105
chain
106106
}
107107

108-
pub fn new(pool_factory: PoolFactory) -> CratesfyiHandler {
108+
fn new(pool_factory: PoolFactory) -> CratesfyiHandler {
109109
let routes = routes::build_routes();
110110
let blacklisted_prefixes = routes.page_prefixes();
111111

@@ -201,7 +201,7 @@ enum MatchVersion {
201201
impl MatchVersion {
202202
/// Convert this `MatchVersion` into an `Option`, discarding whether the matched version came
203203
/// from an exact version number or a semver requirement.
204-
pub fn into_option(self) -> Option<String> {
204+
fn into_option(self) -> Option<String> {
205205
match self {
206206
MatchVersion::Exact(v) | MatchVersion::Semver(v) => Some(v),
207207
MatchVersion::None => None,
@@ -396,7 +396,7 @@ fn redirect(url: Url) -> Response {
396396
resp
397397
}
398398

399-
pub fn redirect_base(req: &Request) -> String {
399+
fn redirect_base(req: &Request) -> String {
400400
// Try to get the scheme from CloudFront first, and then from iron
401401
let scheme = req.headers
402402
.get_raw("cloudfront-forwarded-proto")
@@ -449,18 +449,18 @@ fn ico_handler(req: &mut Request) -> IronResult<Response> {
449449

450450
/// MetaData used in header
451451
#[derive(Debug)]
452-
pub struct MetaData {
453-
pub name: String,
454-
pub version: String,
455-
pub description: Option<String>,
456-
pub target_name: Option<String>,
457-
pub rustdoc_status: bool,
458-
pub default_target: String,
452+
struct MetaData {
453+
name: String,
454+
version: String,
455+
description: Option<String>,
456+
target_name: Option<String>,
457+
rustdoc_status: bool,
458+
default_target: String,
459459
}
460460

461461

462462
impl MetaData {
463-
pub fn from_crate(conn: &Connection, name: &str, version: &str) -> Option<MetaData> {
463+
fn from_crate(conn: &Connection, name: &str, version: &str) -> Option<MetaData> {
464464
for row in &conn.query("SELECT crates.name,
465465
releases.version,
466466
releases.description,

src/web/releases.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ pub fn releases_feed_handler(req: &mut Request) -> IronResult<Response> {
330330
}
331331

332332

333-
pub fn releases_handler(packages: Vec<Release>,
333+
fn releases_handler(packages: Vec<Release>,
334334
page_number: i64,
335335
release_type: &str,
336336
tab: &str,

src/web/rustdoc.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ use utils;
2323

2424
#[derive(Debug)]
2525
struct RustdocPage {
26-
pub head: String,
27-
pub body: String,
28-
pub body_class: String,
29-
pub name: String,
30-
pub full: String,
31-
pub version: String,
32-
pub description: Option<String>,
33-
pub crate_details: Option<CrateDetails>,
26+
head: String,
27+
body: String,
28+
body_class: String,
29+
name: String,
30+
full: String,
31+
version: String,
32+
description: Option<String>,
33+
crate_details: Option<CrateDetails>,
3434
}
3535

3636

src/web/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl FileList {
8282
/// This function is only returning FileList for requested directory. If is empty,
8383
/// it will return list of files (and dirs) for root directory. req_path must be a
8484
/// directory or empty for root directory.
85-
pub fn from_path(conn: &Connection,
85+
fn from_path(conn: &Connection,
8686
name: &str,
8787
version: &str,
8888
req_path: &str)

0 commit comments

Comments
 (0)