summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-27 15:11:26 +0300
committerLars Wirzenius <liw@sequoia-pgp.org>2021-09-30 08:31:09 +0300
commit21aa0ec2cd79a8e5e7268597733526e8d2e64feb (patch)
treeadddc7029aa2de723b4722857c100ecbd09e0355 /ipc
parentca60dfac80459e5fc91d4d6a5b8e76895d3a0f47 (diff)
Drop unnecessary main function from doc test
Test code embedded in document comments do not need to have a main function, the Rust test infrastructure provides one. Keeping the test code shorter is more idiomatic and shorter, both of which make it easier to understand. Found by clippy lint needless_doctest_main: https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
Diffstat (limited to 'ipc')
-rw-r--r--ipc/src/lib.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/ipc/src/lib.rs b/ipc/src/lib.rs
index 23f1fe1b..bda80341 100644
--- a/ipc/src/lib.rs
+++ b/ipc/src/lib.rs
@@ -357,14 +357,11 @@ impl Server {
///
/// use sequoia_ipc::Server;
///
- /// fn main() {
- /// let ctx = Server::context()
- /// .expect("Failed to create context");
- /// Server::new(sequoia_store::descriptor(&ctx))
- /// .expect("Failed to create server")
- /// .serve()
- /// .expect("Failed to start server");
- /// }
+ /// let ctx = Server::context().expect("Failed to create context");
+ /// Server::new(sequoia_store::descriptor(&ctx))
+ /// .expect("Failed to create server")
+ /// .serve()
+ /// .expect("Failed to start server");
/// ```
pub fn serve(&mut self) -> Result<()> {
let listener = platform! {