History

thanks clippy

Sebastian Thiel committed 4 years ago

Commit 854ca681 parent 886c0171 file · +8 −8Browse files

Unified · Split

git-repository/tests/remote/mod.rs+8−8
@@ -12,13 +12,14 @@ pub(crate) fn repo(name: &str) -> git::Repository { · 11 unmodified lines
12 git::open_opts(repo_path(name), git::open::Options::isolated()).unwrap()12 git::open_opts(repo_path(name), git::open::Options::isolated()).unwrap()
13}13}
14 14
15/// Spawn a git-daemon hosting all directories in or below `base_dir` if we are in async mode - currently only TCP is available in async mode,15/// Spawn a git-daemon hosting all directories in or below `base_dir` if we are in async mode - currently only TCP is
16/// and it's probably going to stay that way as we don't want to chose a particular runtime in lower-level crates which16/// available in async mode, and it's probably going to stay that way as we don't want to chose a particular runtime
17/// provide the blocking implementation for everything. Maybe this changes one day once we implement other protocols17/// in lower-level crates just yet.
18/// like spawning a process via `tokio` or `async-std`.18/// Maybe this changes one day once we implement other protocols like spawning a process via `tokio` or `async-std`, or
19/// provide async HTTP implementations as well.
19#[cfg(any(feature = "blocking-network-client", feature = "async-network-client-async-std"))]20#[cfg(any(feature = "blocking-network-client", feature = "async-network-client-async-std"))]
20#[cfg_attr(not(feature = "async-network-client-async-std"), allow(unused_variables))]21#[cfg_attr(not(feature = "async-network-client-async-std"), allow(unused_variables))]
21pub(crate) fn spawn_git_daemon_if_async<'repo, 'a>(22pub(crate) fn spawn_git_daemon_if_async(
22 base_dir: impl AsRef<std::path::Path>,23 base_dir: impl AsRef<std::path::Path>,
23) -> std::io::Result<Option<git_testtools::GitDaemon>> {24) -> std::io::Result<Option<git_testtools::GitDaemon>> {
24 #[cfg(feature = "blocking-network-client")]25 #[cfg(feature = "blocking-network-client")]
@@ -31,11 +32,10 @@ pub(crate) fn spawn_git_daemon_if_async<'repo, 'a>( · 6 unmodified lines
31 }32 }
32}33}
33 34
34/// Turn `remote` into a remote that interacts with the git daemon at `daemon_url`, and `repo_path`35/// Turn `remote` into a remote that interacts with the git `daemon`, all else being the same, by creating a new stand-in remote.
35/// can be a specific repo, or it can be empty if the repo is hosted at the root.
36#[cfg(any(feature = "blocking-network-client", feature = "async-network-client-async-std"))]36#[cfg(any(feature = "blocking-network-client", feature = "async-network-client-async-std"))]
37#[cfg_attr(not(feature = "async-network-client-async-std"), allow(unused_variables))]37#[cfg_attr(not(feature = "async-network-client-async-std"), allow(unused_variables))]
38pub(crate) fn into_daemon_remote_if_async<'repo, 'a>(38pub(crate) fn into_daemon_remote_if_async<'repo>(
39 remote: git::Remote<'repo>,39 remote: git::Remote<'repo>,
40 daemon: Option<&git_testtools::GitDaemon>,40 daemon: Option<&git_testtools::GitDaemon>,
41) -> git::Remote<'repo> {41) -> git::Remote<'repo> {