Skip to content

Commit

Permalink
improve Read implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
pasberth authored and eldesh committed Jan 30, 2019
1 parent 767016c commit 5700a5e
Show file tree
Hide file tree
Showing 18 changed files with 228 additions and 175 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ jobs:
apt list --installed >> /tmp/build-dep
- restore_cache:
key: cache-cargo-target-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLECI_CACHE_VERSION }}-{{ checksum "/tmp/build-dep" }}
- run:
name: Install rustfmt
command: rustup component add rustfmt-preview
- run:
name: Checking source code style
command: cargo fmt -- --write-mode "diff"
command: cargo fmt -- --check
- run:
name: Build project
command: |
Expand Down
2 changes: 1 addition & 1 deletion examples/attach-container.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate dockworker;
extern crate hyper;

use dockworker::{ContainerCreateOptions, ContainerHostConfig, Docker, container::AttachContainer};
use dockworker::{container::AttachContainer, ContainerCreateOptions, ContainerHostConfig, Docker};
use std::io::{BufRead, BufReader};

fn main() {
Expand Down
7 changes: 4 additions & 3 deletions examples/build-image.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extern crate dockworker;
extern crate tar;

use dockworker::{ContainerBuildOptions, Docker};
use std::fs::File;
use std::io::{BufRead, BufReader, Write};
use std::path::Path;
use std::fs::File;
use tar::Builder;
use dockworker::{ContainerBuildOptions, Docker};

fn main() {
{
Expand All @@ -14,7 +14,8 @@ fn main() {
.write_all(
r#"FROM alpine:edge
RUN echo Hi mum
"#.as_bytes(),
"#
.as_bytes(),
)
.unwrap();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/containers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern crate dockworker;

use dockworker::{Docker, container::ContainerFilters};
use dockworker::{container::ContainerFilters, Docker};

fn main() {
let docker = Docker::connect_with_defaults().unwrap();
Expand Down
8 changes: 5 additions & 3 deletions examples/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ fn main() {

println!("History:");
match history {
Ok(changes) => for change in changes {
println!("{:#?}", change);
},
Ok(changes) => {
for change in changes {
println!("{:#?}", change);
}
}
Err(e) => {
println!("Error {}", e);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/prune-image.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern crate dockworker;

use dockworker::{Docker, container::ContainerFilters};
use dockworker::{container::ContainerFilters, Docker};

fn main() {
let docker = Docker::connect_with_defaults().unwrap();
Expand Down
5 changes: 4 additions & 1 deletion examples/push.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
extern crate dockworker;
extern crate hyper;

use dockworker::{Docker, credentials::{Credential, UserPassword}};
use dockworker::{
credentials::{Credential, UserPassword},
Docker,
};

fn main() {
let mut docker = Docker::connect_with_defaults().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/container.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use byteorder::{BigEndian, ReadBytesExt};
use errors::Result;
use hyper_client::Response;
use std;
use std::cell::{Ref, RefCell, RefMut};
use std::collections::HashMap;
use std::io::{self, Read};
use std::rc::Rc;
use std::cell::{Ref, RefCell, RefMut};
use errors::Result;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[allow(non_snake_case)]
Expand Down
3 changes: 1 addition & 2 deletions src/credentials.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use header::XRegistryAuth;
///! Access credentials for accessing any docker daemon endpoints
///!
///! Currently, any values of these types are only used for `/images/{name}/push` api.
use serde_json;
use header::XRegistryAuth;
use system::AuthToken;

/// Access credential
Expand Down
Loading

0 comments on commit 5700a5e

Please sign in to comment.