mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-04-23 20:36:09 +02:00
refactor: rename lib to donutbrowser_lib
This commit is contained in:
@@ -12,7 +12,7 @@ default-run = "donutbrowser"
|
||||
# The `_lib` suffix may seem redundant but it is necessary
|
||||
# to make the lib name unique and wouldn't conflict with the bin name.
|
||||
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
||||
name = "donutbrowser"
|
||||
name = "donutbrowser_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
doctest = false
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use clap::{Arg, Command};
|
||||
use donutbrowser::proxy_runner::{
|
||||
use donutbrowser_lib::proxy_runner::{
|
||||
start_proxy_process, stop_all_proxy_processes, stop_proxy_process,
|
||||
};
|
||||
use donutbrowser::proxy_server::run_proxy_server;
|
||||
use donutbrowser::proxy_storage::get_proxy_config;
|
||||
use donutbrowser_lib::proxy_server::run_proxy_server;
|
||||
use donutbrowser_lib::proxy_storage::get_proxy_config;
|
||||
use std::process;
|
||||
|
||||
fn build_proxy_url(
|
||||
@@ -174,7 +174,7 @@ async fn main() {
|
||||
}
|
||||
} else if let Some(upstream) = stop_matches.get_one::<String>("upstream") {
|
||||
// Find proxies with this upstream URL
|
||||
let configs = donutbrowser::proxy_storage::list_proxy_configs();
|
||||
let configs = donutbrowser_lib::proxy_storage::list_proxy_configs();
|
||||
let matching_configs: Vec<_> = configs
|
||||
.iter()
|
||||
.filter(|config| config.upstream_url == *upstream)
|
||||
@@ -207,7 +207,7 @@ async fn main() {
|
||||
}
|
||||
}
|
||||
} else if proxy_matches.subcommand_matches("list").is_some() {
|
||||
let configs = donutbrowser::proxy_storage::list_proxy_configs();
|
||||
let configs = donutbrowser_lib::proxy_storage::list_proxy_configs();
|
||||
// Use println! here because this needs to go to stdout for parsing
|
||||
println!("{}", serde_json::to_string(&configs).unwrap());
|
||||
process::exit(0);
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
donutbrowser::run()
|
||||
donutbrowser_lib::run()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user