fix warnings

This commit is contained in:
Kasper Juul Hermansen 2023-02-05 21:49:01 +01:00
parent 46157ec536
commit 2b49f9c190
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
2 changed files with 99 additions and 101 deletions

View File

@ -59,10 +59,10 @@ impl Container {
/// * `target` - Target build stage to build. /// * `target` - Target build stage to build.
pub fn build( pub fn build(
&self, &self,
context: DirectoryID, _context: DirectoryID,
dockerfile: Option<String>, _dockerfile: Option<String>,
build_args: Option<Vec<BuildArg>>, _build_args: Option<Vec<BuildArg>>,
target: Option<String>, _target: Option<String>,
) -> Container { ) -> Container {
todo!() todo!()
} }
@ -73,7 +73,7 @@ impl Container {
} }
/// Retrieves a directory at the given path. Mounts are included. /// Retrieves a directory at the given path. Mounts are included.
pub fn directory(&self, path: String) -> Directory { pub fn directory(&self, _path: String) -> Directory {
todo!() todo!()
} }
@ -83,7 +83,7 @@ impl Container {
} }
/// Retrieves the value of the specified environment variable. /// Retrieves the value of the specified environment variable.
pub fn env_variable(&self, name: String) -> Option<String> { pub fn env_variable(&self, _name: String) -> Option<String> {
todo!() todo!()
} }
@ -104,11 +104,11 @@ impl Container {
/// The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM. /// The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
pub fn exec( pub fn exec(
&self, &self,
args: Option<Vec<String>>, _args: Option<Vec<String>>,
stdin: Option<String>, _stdin: Option<String>,
redirect_stdout: Option<String>, _redirect_stdout: Option<String>,
redirect_stderr: Option<String>, _redirect_stderr: Option<String>,
experimental_privileged_nesting: Option<Boolean>, _experimental_privileged_nesting: Option<Boolean>,
) -> Container { ) -> Container {
todo!() todo!()
} }
@ -127,12 +127,12 @@ impl Container {
/// Path can be relative to the engine's workdir or absolute. /// Path can be relative to the engine's workdir or absolute.
/// * `platformVariants` - Identifiers for other platform specific containers. /// * `platformVariants` - Identifiers for other platform specific containers.
/// Used for multi-platform image. /// Used for multi-platform image.
pub fn export(&self, path: String, platform_variants: Option<Vec<ContainerID>>) -> Boolean { pub fn export(&self, _path: String, _platform_variants: Option<Vec<ContainerID>>) -> Boolean {
todo!() todo!()
} }
/// Retrieves a file at the given path. Mounts are included. /// Retrieves a file at the given path. Mounts are included.
pub fn file(&self, path: String) -> File { pub fn file(&self, _path: String) -> File {
todo!() todo!()
} }
@ -141,7 +141,7 @@ impl Container {
/// ///
/// * `address` - Image's address from its registry. /// * `address` - Image's address from its registry.
/// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main). /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
pub fn from(&self, address: String) -> Container { pub fn from(&self, _address: String) -> Container {
todo!() todo!()
} }
@ -156,7 +156,7 @@ impl Container {
} }
/// Retrieves the value of the specified label. /// Retrieves the value of the specified label.
pub fn label(&self, name: String) -> Option<String> { pub fn label(&self, _name: String) -> Option<String> {
todo!() todo!()
} }
@ -171,7 +171,7 @@ impl Container {
} }
/// Creates a named sub-pipeline /// Creates a named sub-pipeline
pub fn pipeline(&self, name: String, description: Option<String>) -> Container { pub fn pipeline(&self, _name: String, _description: Option<String>) -> Container {
todo!() todo!()
} }
@ -187,7 +187,7 @@ impl Container {
/// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main). /// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
/// * `platformVariants` - Identifiers for other platform specific containers. /// * `platformVariants` - Identifiers for other platform specific containers.
/// Used for multi-platform image. /// Used for multi-platform image.
pub fn publish(&self, address: String, platform_variants: Option<Vec<ContainerID>>) -> String { pub fn publish(&self, _address: String, _platform_variants: Option<Vec<ContainerID>>) -> String {
todo!() todo!()
} }
@ -214,28 +214,28 @@ impl Container {
} }
/// Configures default arguments for future commands. /// Configures default arguments for future commands.
pub fn with_default_args(&self, args: Option<Vec<String>>) -> Container { pub fn with_default_args(&self, _args: Option<Vec<String>>) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus a directory written at the given path. /// Retrieves this container plus a directory written at the given path.
pub fn with_directory( pub fn with_directory(
&self, &self,
path: String, _path: String,
directory: DirectoryID, _directory: DirectoryID,
exclude: Option<Vec<String>>, _exclude: Option<Vec<String>>,
include: Option<Vec<String>>, _include: Option<Vec<String>>,
) -> Container { ) -> Container {
todo!() todo!()
} }
/// Retrieves this container but with a different command entrypoint. /// Retrieves this container but with a different command entrypoint.
pub fn with_entrypoint(&self, args: Vec<String>) -> Container { pub fn with_entrypoint(&self, _args: Vec<String>) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus the given environment variable. /// Retrieves this container plus the given environment variable.
pub fn with_env_variable(&self, name: String, value: String) -> Container { pub fn with_env_variable(&self, _name: String, _value: String) -> Container {
todo!() todo!()
} }
@ -251,112 +251,112 @@ impl Container {
/// The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM. /// The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
pub fn with_exec( pub fn with_exec(
&self, &self,
args: Vec<String>, _args: Vec<String>,
stdin: Option<String>, _stdin: Option<String>,
redirect_stdout: Option<String>, _redirect_stdout: Option<String>,
redirect_stderr: Option<String>, _redirect_stderr: Option<String>,
experimental_privileged_nesting: Option<Boolean>, _experimental_privileged_nesting: Option<Boolean>,
) -> Container { ) -> Container {
todo!() todo!()
} }
/// Initializes this container from this DirectoryID. /// Initializes this container from this DirectoryID.
pub fn with_fs(&self, id: DirectoryID) -> Container { pub fn with_fs(&self, _id: DirectoryID) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus the contents of the given file copied to the given path. /// Retrieves this container plus the contents of the given file copied to the given path.
pub fn with_file(&self, path: String, source: FileID, permissions: Option<Int>) -> Container { pub fn with_file(&self, _path: String, _source: FileID, _permissions: Option<Int>) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus the given label. /// Retrieves this container plus the given label.
pub fn with_label(&self, name: String, value: String) -> Container { pub fn with_label(&self, _name: String, _value: String) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus a cache volume mounted at the given path. /// Retrieves this container plus a cache volume mounted at the given path.
pub fn with_mounted_cache( pub fn with_mounted_cache(
&self, &self,
path: String, _path: String,
cache: CacheID, _cache: CacheID,
source: Option<DirectoryID>, _source: Option<DirectoryID>,
) -> Container { ) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus a directory mounted at the given path. /// Retrieves this container plus a directory mounted at the given path.
pub fn with_mounted_directory(&self, path: String, source: DirectoryID) -> Container { pub fn with_mounted_directory(&self, _path: String, _source: DirectoryID) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus a file mounted at the given path. /// Retrieves this container plus a file mounted at the given path.
pub fn with_mounted_file(&self, path: String, source: FileID) -> Container { pub fn with_mounted_file(&self, _path: String, _source: FileID) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus a secret mounted into a file at the given path. /// Retrieves this container plus a secret mounted into a file at the given path.
pub fn with_mounted_secret(&self, path: String, source: SecretID) -> Container { pub fn with_mounted_secret(&self, _path: String, _source: SecretID) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus a temporary directory mounted at the given path. /// Retrieves this container plus a temporary directory mounted at the given path.
pub fn with_mounted_temp(&self, path: String) -> Container { pub fn with_mounted_temp(&self, _path: String) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus a new file written at the given path. /// Retrieves this container plus a new file written at the given path.
pub fn with_new_file( pub fn with_new_file(
&self, &self,
path: String, _path: String,
contents: Option<String>, _contents: Option<String>,
permissions: Option<Int>, _permissions: Option<Int>,
) -> Container { ) -> Container {
todo!() todo!()
} }
/// Initializes this container from this DirectoryID. /// Initializes this container from this DirectoryID.
pub fn with_rootfs(&self, id: DirectoryID) -> Container { pub fn with_rootfs(&self, _id: DirectoryID) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus an env variable containing the given secret. /// Retrieves this container plus an env variable containing the given secret.
pub fn with_secret_variable(&self, name: String, secret: SecretID) -> Container { pub fn with_secret_variable(&self, _name: String, _secret: SecretID) -> Container {
todo!() todo!()
} }
/// Retrieves this container plus a socket forwarded to the given Unix socket path. /// Retrieves this container plus a socket forwarded to the given Unix socket path.
pub fn with_unix_socket(&self, path: String, source: SocketID) -> Container { pub fn with_unix_socket(&self, _path: String, _source: SocketID) -> Container {
todo!() todo!()
} }
/// Retrieves this containers with a different command user. /// Retrieves this containers with a different command user.
pub fn with_user(&self, name: String) -> Container { pub fn with_user(&self, _name: String) -> Container {
todo!() todo!()
} }
/// Retrieves this container with a different working directory. /// Retrieves this container with a different working directory.
pub fn with_workdir(&self, path: String) -> Container { pub fn with_workdir(&self, _path: String) -> Container {
todo!() todo!()
} }
/// Retrieves this container minus the given environment variable. /// Retrieves this container minus the given environment variable.
pub fn without_env_variable(&self, name: String) -> Container { pub fn without_env_variable(&self, _name: String) -> Container {
todo!() todo!()
} }
/// Retrieves this container minus the given environment label. /// Retrieves this container minus the given environment label.
pub fn without_label(&self, name: String) -> Container { pub fn without_label(&self, _name: String) -> Container {
todo!() todo!()
} }
/// Retrieves this container after unmounting everything at the given path. /// Retrieves this container after unmounting everything at the given path.
pub fn without_mount(&self, path: String) -> Container { pub fn without_mount(&self, _path: String) -> Container {
todo!() todo!()
} }
/// Retrieves this container with a previously added Unix socket removed. /// Retrieves this container with a previously added Unix socket removed.
pub fn without_unix_socket(&self, path: String) -> Container { pub fn without_unix_socket(&self, _path: String) -> Container {
todo!() todo!()
} }
@ -373,12 +373,12 @@ pub struct Directory {}
impl Directory { impl Directory {
/// Gets the difference between this directory and an another directory. /// Gets the difference between this directory and an another directory.
pub fn diff(&self, other: DirectoryID) -> Directory { pub fn diff(&self, _other: DirectoryID) -> Directory {
todo!() todo!()
} }
/// Retrieves a directory at the given path. /// Retrieves a directory at the given path.
pub fn directory(&self, path: String) -> Directory { pub fn directory(&self, _path: String) -> Directory {
todo!() todo!()
} }
@ -392,26 +392,26 @@ impl Directory {
/// * `target` - Target build stage to build. /// * `target` - Target build stage to build.
pub fn docker_build( pub fn docker_build(
&self, &self,
dockerfile: Option<String>, _dockerfile: Option<String>,
platform: Option<Platform>, _platform: Option<Platform>,
build_args: Option<Vec<BuildArg>>, _build_args: Option<Vec<BuildArg>>,
target: Option<String>, _target: Option<String>,
) -> Container { ) -> Container {
todo!() todo!()
} }
/// Returns a list of files and directories at the given path. /// Returns a list of files and directories at the given path.
pub fn entries(&self, path: Option<String>) -> Vec<String> { pub fn entries(&self, _path: Option<String>) -> Vec<String> {
todo!() todo!()
} }
/// Writes the contents of the directory to a path on the host. /// Writes the contents of the directory to a path on the host.
pub fn export(&self, path: String) -> Boolean { pub fn export(&self, _path: String) -> Boolean {
todo!() todo!()
} }
/// Retrieves a file at the given path. /// Retrieves a file at the given path.
pub fn file(&self, path: String) -> File { pub fn file(&self, _path: String) -> File {
todo!() todo!()
} }
@ -421,12 +421,12 @@ impl Directory {
} }
/// load a project's metadata /// load a project's metadata
pub fn load_project(&self, config_path: String) -> Project { pub fn load_project(&self, _config_path: String) -> Project {
todo!() todo!()
} }
/// Creates a named sub-pipeline. /// Creates a named sub-pipeline.
pub fn pipeline(&self, name: String, description: Option<String>) -> Directory { pub fn pipeline(&self, _name: String, _description: Option<String>) -> Directory {
todo!() todo!()
} }
@ -439,46 +439,46 @@ impl Directory {
/// (e.g. ["app/", "package.*"]). /// (e.g. ["app/", "package.*"]).
pub fn with_directory( pub fn with_directory(
&self, &self,
path: String, _path: String,
directory: DirectoryID, _directory: DirectoryID,
exclude: Option<Vec<String>>, _exclude: Option<Vec<String>>,
include: Option<Vec<String>>, _include: Option<Vec<String>>,
) -> Directory { ) -> Directory {
todo!() todo!()
} }
/// Retrieves this directory plus the contents of the given file copied to the given path. /// Retrieves this directory plus the contents of the given file copied to the given path.
pub fn with_file(&self, path: String, source: FileID, permissions: Option<Int>) -> Directory { pub fn with_file(&self, _path: String, _source: FileID, _permissions: Option<Int>) -> Directory {
todo!() todo!()
} }
/// Retrieves this directory plus a new directory created at the given path. /// Retrieves this directory plus a new directory created at the given path.
pub fn with_new_directory(&self, path: String, permissions: Option<Int>) -> Directory { pub fn with_new_directory(&self, _path: String, _permissions: Option<Int>) -> Directory {
todo!() todo!()
} }
/// Retrieves this directory plus a new file written at the given path. /// Retrieves this directory plus a new file written at the given path.
pub fn with_new_file( pub fn with_new_file(
&self, &self,
path: String, _path: String,
contents: String, _contents: String,
permissions: Option<Int>, _permissions: Option<Int>,
) -> Directory { ) -> Directory {
todo!() todo!()
} }
/// Retrieves this directory with all file/dir timestamps set to the given time, in seconds from the Unix epoch. /// Retrieves this directory with all file/dir timestamps set to the given time, in seconds from the Unix epoch.
pub fn with_timestamps(&self, timestamp: Int) -> Directory { pub fn with_timestamps(&self, _timestamp: Int) -> Directory {
todo!() todo!()
} }
/// Retrieves this directory with the directory at the given path removed. /// Retrieves this directory with the directory at the given path removed.
pub fn without_directory(&self, path: String) -> Directory { pub fn without_directory(&self, _path: String) -> Directory {
todo!() todo!()
} }
/// Retrieves this directory with the file at the given path removed. /// Retrieves this directory with the file at the given path removed.
pub fn without_file(&self, path: String) -> Directory { pub fn without_file(&self, _path: String) -> Directory {
todo!() todo!()
} }
} }
@ -512,7 +512,7 @@ impl File {
} }
/// Writes the file to a file path on the host. /// Writes the file to a file path on the host.
pub fn export(&self, path: String) -> Boolean { pub fn export(&self, _path: String) -> Boolean {
todo!() todo!()
} }
@ -532,7 +532,7 @@ impl File {
} }
/// Retrieves this file with its created/modified timestamps set to the given time, in seconds from the Unix epoch. /// Retrieves this file with its created/modified timestamps set to the given time, in seconds from the Unix epoch.
pub fn with_timestamps(&self, timestamp: Int) -> File { pub fn with_timestamps(&self, _timestamp: Int) -> File {
todo!() todo!()
} }
} }
@ -551,8 +551,8 @@ impl GitRef {
/// The filesystem tree at this ref. /// The filesystem tree at this ref.
pub fn tree( pub fn tree(
&self, &self,
ssh_known_hosts: Option<String>, _ssh_known_hosts: Option<String>,
ssh_auth_socket: Option<SocketID>, _ssh_auth_socket: Option<SocketID>,
) -> Directory { ) -> Directory {
todo!() todo!()
} }
@ -565,7 +565,7 @@ pub struct GitRepository {}
impl GitRepository { impl GitRepository {
/// Returns details on one branch. /// Returns details on one branch.
pub fn branch(&self, name: String) -> GitRef { pub fn branch(&self, _name: String) -> GitRef {
todo!() todo!()
} }
@ -575,12 +575,12 @@ impl GitRepository {
} }
/// Returns details on one commit. /// Returns details on one commit.
pub fn commit(&self, id: String) -> GitRef { pub fn commit(&self, _id: String) -> GitRef {
todo!() todo!()
} }
/// Returns details on one tag. /// Returns details on one tag.
pub fn tag(&self, name: String) -> GitRef { pub fn tag(&self, _name: String) -> GitRef {
todo!() todo!()
} }
@ -599,25 +599,25 @@ impl Host {
/// Accesses a directory on the host. /// Accesses a directory on the host.
pub fn directory( pub fn directory(
&self, &self,
path: String, _path: String,
exclude: Option<Vec<String>>, _exclude: Option<Vec<String>>,
include: Option<Vec<String>>, _include: Option<Vec<String>>,
) -> Directory { ) -> Directory {
todo!() todo!()
} }
/// Accesses an environment variable on the host. /// Accesses an environment variable on the host.
pub fn env_variable(&self, name: String) -> Option<HostVariable> { pub fn env_variable(&self, _name: String) -> Option<HostVariable> {
todo!() todo!()
} }
/// Accesses a Unix socket on the host. /// Accesses a Unix socket on the host.
pub fn unix_socket(&self, path: String) -> Socket { pub fn unix_socket(&self, _path: String) -> Socket {
todo!() todo!()
} }
/// Retrieves the current working directory on the host. /// Retrieves the current working directory on the host.
pub fn workdir(&self, exclude: Option<Vec<String>>, include: Option<Vec<String>>) -> Directory { pub fn workdir(&self, _exclude: Option<Vec<String>>, _include: Option<Vec<String>>) -> Directory {
todo!() todo!()
} }
} }
@ -703,14 +703,14 @@ impl Query {
/// # Arguments /// # Arguments
/// ///
/// * `key` - A string identifier to target this cache volume (e.g. "myapp-cache"). /// * `key` - A string identifier to target this cache volume (e.g. "myapp-cache").
pub fn cache_volume(&self, key: String) -> CacheVolume { pub fn cache_volume(&self, _key: String) -> CacheVolume {
todo!() todo!()
} }
/// Loads a container from ID. /// Loads a container from ID.
/// Null ID returns an empty container (scratch). /// Null ID returns an empty container (scratch).
/// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host. /// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
pub fn container(&self, id: Option<ContainerID>, platform: Option<Platform>) -> Container { pub fn container(&self, _id: Option<ContainerID>, _platform: Option<Platform>) -> Container {
todo!() todo!()
} }
@ -720,17 +720,17 @@ impl Query {
} }
/// Load a directory by ID. No argument produces an empty directory. /// Load a directory by ID. No argument produces an empty directory.
pub fn directory(&self, id: Option<DirectoryID>) -> Directory { pub fn directory(&self, _id: Option<DirectoryID>) -> Directory {
todo!() todo!()
} }
/// Loads a file by ID. /// Loads a file by ID.
pub fn file(&self, id: FileID) -> Option<File> { pub fn file(&self, _id: FileID) -> Option<File> {
todo!() todo!()
} }
/// Queries a git repository. /// Queries a git repository.
pub fn git(&self, url: String, keep_git_dir: Option<Boolean>) -> GitRepository { pub fn git(&self, _url: String, _keep_git_dir: Option<Boolean>) -> GitRepository {
todo!() todo!()
} }
@ -740,27 +740,27 @@ impl Query {
} }
/// Returns a file containing an http remote url content. /// Returns a file containing an http remote url content.
pub fn http(&self, url: String) -> File { pub fn http(&self, _url: String) -> File {
todo!() todo!()
} }
/// Creates a named sub-pipeline /// Creates a named sub-pipeline
pub fn pipeline(&self, name: String, description: Option<String>) -> Query { pub fn pipeline(&self, _name: String, _description: Option<String>) -> Query {
todo!() todo!()
} }
/// Look up a project by name /// Look up a project by name
pub fn project(&self, name: String) -> Project { pub fn project(&self, _name: String) -> Project {
todo!() todo!()
} }
/// Loads a secret from its ID. /// Loads a secret from its ID.
pub fn secret(&self, id: SecretID) -> Secret { pub fn secret(&self, _id: SecretID) -> Secret {
todo!() todo!()
} }
/// Loads a socket by its ID. /// Loads a socket by its ID.
pub fn socket(&self, id: Option<SocketID>) -> Socket { pub fn socket(&self, _id: Option<SocketID>) -> Socket {
todo!() todo!()
} }
} }

View File

@ -1,12 +1,10 @@
use std::{ use std::{
any::Any,
collections::HashMap, collections::HashMap,
ops::Add, ops::Add,
rc::Rc, sync::{Arc},
sync::{Arc, Once},
}; };
use serde::{Deserialize, Serialize}; use serde::{Serialize};
pub fn query() -> Selection { pub fn query() -> Selection {
Selection { Selection {