chainwayxyz / clementine

Citrea's BitVM Based Trust-Minimized Two-Way Peg Program
https://www.blog.citrea.xyz/unveiling-clementine
55 stars 10 forks source link

Convert library to binary #308

Open ceyhunsen opened 2 weeks ago

ceyhunsen commented 2 weeks ago

Proposal Description

Currently, Clementine is qualified as a library, by Rust directives (have a lib.rs and not a main.rs). But structurally, it is a binary. If it is expected other binaries to depend code on this library, then it is fine. But if it's not, there is a problem for developers: Because every module is declared as public and Rust allows unused functions in libraries, codebase has uncatched unused functions. Maybe other linting hints are also hidden.

If it is not wanted Clementine to be a library, lib.rs should be removed and main.rs should be created. Helper binaries can still be present in bin/ directory.

ekrembal commented 1 day ago

We sometimes use clementine as a library, but we can move server.rs binary to the main.rs since it should be the only binary