Skip to content

Commit cb48884

Browse files
chore: move "ferron-common" to Ferron itself
1 parent 895a023 commit cb48884

27 files changed

+72
-98
lines changed

Cargo.lock

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[workspace]
22
members = [
33
"ferron",
4-
"ferron-common",
54
"ferron-passwd",
65
]
76
resolver = "2"
@@ -10,7 +9,6 @@ resolver = "2"
109
hyper = { version = "1.6.0", features = ["http1", "http2", "server"] }
1110
tokio = { version = "1.43.0", features = ["full"] }
1211
tokio-test = "0.4.4"
13-
ferron-common = { path = "./ferron-common" }
1412
http-body-util = "0.1"
1513
yaml-rust2 = "0.10.0"
1614
async-trait = "0.1.86"

ferron-common/Cargo.toml

Lines changed: 0 additions & 17 deletions
This file was deleted.

ferron/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ anyhow = "1.0.95"
2121
futures-util = "0.3.31"
2222
chrono = "0.4.39"
2323
async-trait = { workspace = true }
24-
ferron-common = { workspace = true }
2524
rustls-native-certs = "0.8.1"
2625
ocsp-stapler = { version = "0.4.4", default-features = false }
2726
clap = { version = "4.5.28", features = ["derive"] }
@@ -39,7 +38,7 @@ itertools = { version = "0.14.0", optional = true }
3938
rand = "0.9.0"
4039
memmem = { version = "0.1.1", optional = true }
4140
httparse = { version = "1.10.0", optional = true }
42-
pin-project-lite = { version = "0.2.16", optional = true }
41+
pin-project-lite = "0.2.16"
4342
hashlink = "0.10.0"
4443
tokio-rustls-acme = "0.6.0"
4544
glob = "0.3.2"
@@ -57,7 +56,7 @@ cache = ["itertools"]
5756
cgi = ["httparse", "memmem"]
5857
example = []
5958
fauth = []
60-
fcgi = ["httparse", "memmem", "pin-project-lite"]
59+
fcgi = ["httparse", "memmem"]
6160
fproxy = []
6261
rproxy = []
6362
scgi = ["httparse", "memmem"]
File renamed without changes.

ferron-common/src/lib.rs renamed to ferron/src/common/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(dead_code)]
2+
13
use std::{error::Error, future::Future, net::SocketAddr, pin::Pin};
24

35
use async_channel::Sender;
@@ -8,7 +10,9 @@ use hyper_tungstenite::HyperWebsocket;
810
use tokio::runtime::Handle;
911
use yaml_rust2::Yaml;
1012

13+
#[path = "log.rs"]
1114
mod log;
15+
#[path = "with_runtime.rs"]
1216
mod with_runtime;
1317

1418
/// Contains information about a network socket, including remote and local addresses,
@@ -44,7 +48,7 @@ impl SocketData {
4448
}
4549

4650
/// Represents a log message. This is a type alias for `crate::log::LogMessage`.
47-
pub type LogMessage = crate::log::LogMessage;
51+
pub type LogMessage = log::LogMessage;
4852

4953
/// Represents the server configuration object. This is a type alias for `Yaml` from the `yaml_rust2` crate.
5054
pub type ServerConfig = Yaml;
@@ -60,7 +64,7 @@ pub type HyperUpgraded = Upgraded;
6064

6165
/// A wrapper that ensures a function is executed within a specific runtime context.
6266
/// This is a type alias for `crate::with_runtime::WithRuntime<F>`.
63-
pub type WithRuntime<F> = crate::with_runtime::WithRuntime<F>;
67+
pub type WithRuntime<F> = with_runtime::WithRuntime<F>;
6468

6569
/// Contains data related to an HTTP request, including the original Hyper request
6670
/// and optional authentication user information.
@@ -175,7 +179,7 @@ impl ErrorLogger {
175179
/// # Examples
176180
///
177181
/// ```
178-
/// # use ferron_common::ErrorLogger;
182+
/// # use crate::ferron_common::ErrorLogger;
179183
/// # #[tokio::main]
180184
/// # async fn main() {
181185
/// let (tx, mut rx) = async_channel::bounded(100);
File renamed without changes.

ferron/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ mod ferron_res {
1212
pub mod server_software;
1313
}
1414

15+
// Import common modules from "common" directory
16+
#[path = "common/mod.rs"]
17+
mod ferron_common;
18+
1519
// Import utility modules from "util" directory
1620
#[path = "util"]
1721
mod ferron_util {

ferron/src/modules/blocklist.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::error::Error;
22
use std::sync::Arc;
33

4-
use async_trait::async_trait;
5-
use ferron_common::{
4+
use crate::ferron_common::{
65
ErrorLogger, HyperResponse, RequestData, ResponseData, ServerConfig, ServerModule,
76
ServerModuleHandlers, SocketData,
87
};
9-
use ferron_common::{HyperUpgraded, WithRuntime};
8+
use crate::ferron_common::{HyperUpgraded, WithRuntime};
9+
use async_trait::async_trait;
1010
use hyper::StatusCode;
1111
use hyper_tungstenite::HyperWebsocket;
1212
use tokio::runtime::Handle;

ferron/src/modules/default_handler_checks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::error::Error;
22

3-
use async_trait::async_trait;
4-
use ferron_common::{
3+
use crate::ferron_common::{
54
ErrorLogger, HyperResponse, RequestData, ResponseData, ServerConfig, ServerModule,
65
ServerModuleHandlers, SocketData,
76
};
8-
use ferron_common::{HyperUpgraded, WithRuntime};
7+
use crate::ferron_common::{HyperUpgraded, WithRuntime};
8+
use async_trait::async_trait;
99
use http_body_util::{BodyExt, Empty};
1010
use hyper::header::HeaderValue;
1111
use hyper::{header, HeaderMap, Method, Response, StatusCode};

0 commit comments

Comments
 (0)