Skip to content

Commit 34e61fc

Browse files
refactor(Rest): separate binary entry point from library code
Move the main function from Library.rs to a dedicated Binary.rs entry point file, updating Cargo.toml to reference the new binary path. This follows standard Rust project structure with the library implementation in Library.rs and the binary entry point isolated in Binary.rs.
1 parent c3beceb commit 34e61fc

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[[bin]]
22
name = "Rest"
3-
path = "Source/Library.rs"
3+
path = "Source/Binary.rs"
44

55
[build-dependencies]
66
serde = { workspace = true, features = ["derive"] }

Source/Binary.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![allow(non_snake_case)]
2+
3+
//! Binary entry point for Rest.
4+
5+
use Library::Fn as Struct;
6+
7+
#[tokio::main]
8+
async fn main() { (Struct::Binary::Command::Struct::Fn().Fn)().await }

Source/Library.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
/// async fn main() { (Struct::Binary::Command::Struct::Fn().Fn)().await }
4545
4646
/// ```
47-
async fn main() { (Struct::Binary::Command::Struct::Fn().Fn)().await }
4847
4948
pub mod Fn;
5049

0 commit comments

Comments
 (0)