Skip to content

Commit

Permalink
upgrade MSRV 1.65 -> 1.67
Browse files Browse the repository at this point in the history
  • Loading branch information
fuchsnj committed Aug 23, 2023
1 parent 61564c6 commit f2b437a
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.65.0-buster
FROM rust:1.67.0-buster

WORKDIR /usr/src/bollard

Expand Down
2 changes: 1 addition & 1 deletion examples/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ async fn main() {
let mut image_build_stream = docker.build_image(build_image_options, None, None);

while let Some(msg) = image_build_stream.next().await {
println!("Message: {:?}", msg);
println!("Message: {msg:?}");
}
}
2 changes: 1 addition & 1 deletion examples/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
.id;
if let StartExecResults::Attached { mut output, .. } = docker.start_exec(&exec, None).await? {
while let Some(Ok(msg)) = output.next().await {
print!("{}", msg);
print!("{msg}");
}
} else {
unreachable!();
Expand Down
8 changes: 4 additions & 4 deletions examples/hoover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,29 @@ async fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
}))
.await?;

println!("{:?}", prune);
println!("{prune:?}");

let prune = docker
.prune_images(Some(PruneImagesOptions {
filters: prune_filters.clone(),
}))
.await?;

println!("{:?}", prune);
println!("{prune:?}");

let prune = docker
.prune_volumes(None::<PruneVolumesOptions<String>>)
.await?;

println!("{:?}", prune);
println!("{prune:?}");

let prune = docker
.prune_networks(Some(PruneNetworksOptions {
filters: prune_filters.clone(),
}))
.await?;

println!("{:?}", prune);
println!("{prune:?}");

Ok(())
}
2 changes: 1 addition & 1 deletion examples/kafka.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
let mut stream = select(&mut stream1, &mut stream2);

while let Some(msg) = stream.next().await {
println!("Message: {:?}", msg);
println!("Message: {msg:?}");
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion examples/post_dockerfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ async fn main() {
let mut image_build_stream = docker.build_image(image_options, None, Some(body));

while let Some(msg) = image_build_stream.next().await {
println!("Message: {:?}", msg);
println!("Message: {msg:?}");
}
}
4 changes: 2 additions & 2 deletions examples/top.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
))) = futures.next().await
{
if let Some(p) = p.get(0) {
print!("{}", name);
print!("{name}");
for mut v in p.iter().cloned() {
if v.len() > 30 {
v.truncate(30);
}
print!("\t{}", v);
print!("\t{v}");
}
println!();
}
Expand Down
38 changes: 19 additions & 19 deletions src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/start", container_name);
let url = format!("/containers/{container_name}/start");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1326,7 +1326,7 @@ impl Docker {
container_name: &str,
options: Option<StopContainerOptions>,
) -> Result<(), Error> {
let url = format!("/containers/{}/stop", container_name);
let url = format!("/containers/{container_name}/stop");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1375,7 +1375,7 @@ impl Docker {
container_name: &str,
options: Option<RemoveContainerOptions>,
) -> Result<(), Error> {
let url = format!("/containers/{}", container_name);
let url = format!("/containers/{container_name}");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1426,7 +1426,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/wait", container_name);
let url = format!("/containers/{container_name}/wait");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1497,7 +1497,7 @@ impl Docker {
where
T: Into<String> + Serialize + Default,
{
let url = format!("/containers/{}/attach", container_name);
let url = format!("/containers/{container_name}/attach");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1549,7 +1549,7 @@ impl Docker {
container_name: &str,
options: ResizeContainerTtyOptions,
) -> Result<(), Error> {
let url = format!("/containers/{}/resize", container_name);
let url = format!("/containers/{container_name}/resize");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1595,7 +1595,7 @@ impl Docker {
container_name: &str,
options: Option<RestartContainerOptions>,
) -> Result<(), Error> {
let url = format!("/containers/{}/restart", container_name);
let url = format!("/containers/{container_name}/restart");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1640,7 +1640,7 @@ impl Docker {
container_name: &str,
options: Option<InspectContainerOptions>,
) -> Result<ContainerInspectResponse, Error> {
let url = format!("/containers/{}/json", container_name);
let url = format!("/containers/{container_name}/json");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1688,7 +1688,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/top", container_name);
let url = format!("/containers/{container_name}/top");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1741,7 +1741,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/logs", container_name);
let url = format!("/containers/{container_name}/logs");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1780,7 +1780,7 @@ impl Docker {
&self,
container_name: &str,
) -> Result<Option<Vec<FilesystemChange>>, Error> {
let url = format!("/containers/{}/changes", container_name);
let url = format!("/containers/{container_name}/changes");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1828,7 +1828,7 @@ impl Docker {
container_name: &str,
options: Option<StatsOptions>,
) -> impl Stream<Item = Result<Stats, Error>> {
let url = format!("/containers/{}/stats", container_name);
let url = format!("/containers/{container_name}/stats");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1877,7 +1877,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/kill", container_name);
let url = format!("/containers/{container_name}/kill");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1929,7 +1929,7 @@ impl Docker {
where
T: Into<String> + Eq + Hash + Serialize,
{
let url = format!("/containers/{}/update", container_name);
let url = format!("/containers/{container_name}/update");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -1978,7 +1978,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/rename", container_name);
let url = format!("/containers/{container_name}/rename");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -2013,7 +2013,7 @@ impl Docker {
/// docker.pause_container("postgres");
/// ```
pub async fn pause_container(&self, container_name: &str) -> Result<(), Error> {
let url = format!("/containers/{}/pause", container_name);
let url = format!("/containers/{container_name}/pause");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -2048,7 +2048,7 @@ impl Docker {
/// docker.unpause_container("postgres");
/// ```
pub async fn unpause_container(&self, container_name: &str) -> Result<(), Error> {
let url = format!("/containers/{}/unpause", container_name);
let url = format!("/containers/{container_name}/unpause");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -2156,7 +2156,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/archive", container_name);
let url = format!("/containers/{container_name}/archive");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -2206,7 +2206,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/archive", container_name);
let url = format!("/containers/{container_name}/archive");

let req = self.build_request(
&url,
Expand Down
2 changes: 1 addition & 1 deletion src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ where
S: serde::Serializer,
{
s.serialize_str(
&serde_json::to_string(t).map_err(|e| serde::ser::Error::custom(format!("{}", e)))?,
&serde_json::to_string(t).map_err(|e| serde::ser::Error::custom(format!("{e}")))?,
)
}

Expand Down
8 changes: 4 additions & 4 deletions src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/containers/{}/exec", container_name);
let url = format!("/containers/{container_name}/exec");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -194,7 +194,7 @@ impl Docker {
exec_id: &str,
config: Option<StartExecOptions>,
) -> Result<StartExecResults, Error> {
let url = format!("/exec/{}/start", exec_id);
let url = format!("/exec/{exec_id}/start");

match config {
Some(StartExecOptions { detach: true, .. }) => {
Expand Down Expand Up @@ -278,7 +278,7 @@ impl Docker {
/// };
/// ```
pub async fn inspect_exec(&self, exec_id: &str) -> Result<ExecInspectResponse, Error> {
let url = format!("/exec/{}/json", exec_id);
let url = format!("/exec/{exec_id}/json");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -329,7 +329,7 @@ impl Docker {
exec_id: &str,
options: ResizeExecOptions,
) -> Result<(), Error> {
let url = format!("/exec/{}/resize", exec_id);
let url = format!("/exec/{exec_id}/resize");

let req = self.build_request(
&url,
Expand Down
12 changes: 6 additions & 6 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ impl Docker {
/// docker.inspect_image("hello-world");
/// ```
pub async fn inspect_image(&self, image_name: &str) -> Result<ImageInspect, Error> {
let url = format!("/images/{}/json", image_name);
let url = format!("/images/{image_name}/json");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -698,7 +698,7 @@ impl Docker {
/// docker.image_history("hello-world");
/// ```
pub async fn image_history(&self, image_name: &str) -> Result<Vec<HistoryResponseItem>, Error> {
let url = format!("/images/{}/history", image_name);
let url = format!("/images/{image_name}/history");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -803,7 +803,7 @@ impl Docker {
options: Option<RemoveImageOptions>,
credentials: Option<DockerCredentials>,
) -> Result<Vec<ImageDeleteResponseItem>, Error> {
let url = format!("/images/{}", image_name);
let url = format!("/images/{image_name}");

match serde_json::to_string(&credentials.unwrap_or_else(|| DockerCredentials {
..Default::default()
Expand Down Expand Up @@ -862,7 +862,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/images/{}/tag", image_name);
let url = format!("/images/{image_name}/tag");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -922,7 +922,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/images/{}/push", image_name);
let url = format!("/images/{image_name}/push");

match serde_json::to_string(&credentials.unwrap_or_else(|| DockerCredentials {
..Default::default()
Expand Down Expand Up @@ -1210,7 +1210,7 @@ impl Docker {
/// # Returns
/// - An uncompressed TAR archive
pub fn export_image(&self, image_name: &str) -> impl Stream<Item = Result<Bytes, Error>> {
let url = format!("/images/{}/get", image_name);
let url = format!("/images/{image_name}/get");
let req = self.build_request(
&url,
Builder::new()
Expand Down
8 changes: 4 additions & 4 deletions src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl Docker {
/// docker.remove_network("my_network_name");
/// ```
pub async fn remove_network(&self, network_name: &str) -> Result<(), Error> {
let url = format!("/networks/{}", network_name);
let url = format!("/networks/{network_name}");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -309,7 +309,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/networks/{}", network_name);
let url = format!("/networks/{network_name}");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -417,7 +417,7 @@ impl Docker {
where
T: Into<String> + Eq + Hash + Serialize,
{
let url = format!("/networks/{}/connect", network_name);
let url = format!("/networks/{network_name}/connect");

let req = self.build_request(
&url,
Expand Down Expand Up @@ -466,7 +466,7 @@ impl Docker {
where
T: Into<String> + Serialize,
{
let url = format!("/networks/{}/disconnect", network_name);
let url = format!("/networks/{network_name}/disconnect");

let req = self.build_request(
&url,
Expand Down
Loading

0 comments on commit f2b437a

Please sign in to comment.