Skip to content

Commit

Permalink
Merge pull request #106 from steveeJ-forks/pr/fix-rustc-warnings-1.34.0
Browse files Browse the repository at this point in the history
*: fix all rustc 1.34 warnings
  • Loading branch information
steveej authored Apr 25, 2019
2 parents b06a641 + b67d62c commit 0d4317d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ impl str::FromStr for Version {
type Err = ::errors::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let v = match s.chars().nth(0) {
Some(':') => Version::Tag(s.trim_left_matches(':').to_string()),
Some(':') => Version::Tag(s.trim_start_matches(':').to_string()),
Some('@') => {
let r: Vec<&str> = s.trim_left_matches('@').splitn(2, ':').collect();
let r: Vec<&str> = s.trim_start_matches('@').splitn(2, ':').collect();
if r.len() != 2 {
bail!("wrong digest format");
};
Expand Down Expand Up @@ -159,7 +159,7 @@ fn parse_url(input: &str) -> Result<Reference, Error> {
// Detect and remove schema.
let has_schema = rest.starts_with("docker://");
if has_schema {
rest = input.trim_left_matches("docker://");
rest = input.trim_start_matches("docker://");
};

// Split path components apart and retain non-empty ones.
Expand Down
2 changes: 1 addition & 1 deletion src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn unpack(layers: &[Vec<u8>], target_dir: &path::Path) -> Result<()> {
path::PathBuf::from("./".to_string() + &parent.to_string_lossy());

// Remove real file behind whiteout
let real_name = wh_name.trim_left_matches(".wh.");
let real_name = wh_name.trim_start_matches(".wh.");
let abs_real_path = target_dir.join(&rel_parent).join(real_name);
fs::remove_dir_all(abs_real_path)?;

Expand Down
2 changes: 1 addition & 1 deletion src/v2/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Client {
.and_then(move |hdr| {
let mut auth_ep = "".to_owned();
let mut service = None;
for item in hdr.trim_left_matches("Bearer ").split(',') {
for item in hdr.trim_start_matches("Bearer ").split(',') {
let kv: Vec<&str> = item.split('=').collect();
match (kv.get(0), kv.get(1)) {
(Some(&"realm"), Some(v)) => auth_ep = v.trim_matches('"').to_owned(),
Expand Down
1 change: 0 additions & 1 deletion src/v2/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use errors::{Error, Result};
use futures::{self, stream, Future, Stream};
use reqwest::StatusCode;
use serde_json;
use std::str::FromStr;
use v2;

/// Convenience alias for a stream of `String` repos.
Expand Down
1 change: 1 addition & 0 deletions src/v2/manifest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use v2::*;
use futures::{future, Stream};
use mime;
use reqwest::{self, header, StatusCode, Url};
use std::str::FromStr;

mod manifest_schema1;
pub use self::manifest_schema1::*;
Expand Down
2 changes: 0 additions & 2 deletions src/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ use futures::prelude::*;
use reqwest::StatusCode;
use serde_json;

use std::str::FromStr;

mod config;
pub use self::config::Config;

Expand Down
2 changes: 1 addition & 1 deletion src/v2/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn parse_link(hdr: Option<header::HeaderValue>) -> Option<String> {
};

// Query parameters for next page URL.
let uri = sval.trim_right_matches(">; rel=\"next\"");
let uri = sval.trim_end_matches(">; rel=\"next\"");
let query: Vec<&str> = uri.splitn(2, "next_page=").collect();
let params = match query.get(1) {
Some(v) if *v != "" => v,
Expand Down

0 comments on commit 0d4317d

Please sign in to comment.