chore: make library
This commit is contained in:
parent
3ff907d6c1
commit
49ef59e000
13
src/lib.rs
Normal file
13
src/lib.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
pub mod client;
|
||||||
|
pub mod config;
|
||||||
|
pub mod duplicates;
|
||||||
|
pub mod instance_info;
|
||||||
|
pub mod oauth;
|
||||||
|
pub mod oauth_resources;
|
||||||
|
pub mod post;
|
||||||
|
pub mod search;
|
||||||
|
pub mod server;
|
||||||
|
pub mod settings;
|
||||||
|
pub mod subreddit;
|
||||||
|
pub mod user;
|
||||||
|
pub mod utils;
|
25
src/main.rs
25
src/main.rs
@ -2,35 +2,20 @@
|
|||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![allow(clippy::cmp_owned)]
|
#![allow(clippy::cmp_owned)]
|
||||||
|
|
||||||
// Reference local files
|
|
||||||
mod config;
|
|
||||||
mod duplicates;
|
|
||||||
mod instance_info;
|
|
||||||
mod oauth;
|
|
||||||
mod oauth_resources;
|
|
||||||
mod post;
|
|
||||||
mod search;
|
|
||||||
mod settings;
|
|
||||||
mod subreddit;
|
|
||||||
mod user;
|
|
||||||
mod utils;
|
|
||||||
|
|
||||||
// Import Crates
|
// Import Crates
|
||||||
use clap::{Arg, ArgAction, Command};
|
use clap::{Arg, ArgAction, Command};
|
||||||
|
|
||||||
use futures_lite::FutureExt;
|
use futures_lite::FutureExt;
|
||||||
use hyper::{header::HeaderValue, Body, Request, Response};
|
use hyper::{header::HeaderValue, Body, Request, Response};
|
||||||
|
|
||||||
mod client;
|
|
||||||
use client::{canonical_path, proxy};
|
|
||||||
use log::info;
|
use log::info;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use server::RequestExt;
|
use redlib::client::{canonical_path, proxy};
|
||||||
use utils::{error, redirect, ThemeAssets};
|
use redlib::server::{self, RequestExt};
|
||||||
|
use redlib::utils::{error, redirect, ThemeAssets};
|
||||||
|
use redlib::{config, duplicates, headers, instance_info, post, search, settings, subreddit, user};
|
||||||
|
|
||||||
use crate::client::OAUTH_CLIENT;
|
use redlib::client::OAUTH_CLIENT;
|
||||||
|
|
||||||
mod server;
|
|
||||||
|
|
||||||
// Create Services
|
// Create Services
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
use crate::utils::{self, catch_random, error, filter_posts, format_num, format_url, get_filters, param, redirect, setting, template, val, Post, Preferences};
|
use crate::utils::{self, catch_random, error, filter_posts, format_num, format_url, get_filters, param, redirect, setting, template, val, Post, Preferences};
|
||||||
use crate::{
|
use crate::{
|
||||||
client::json,
|
client::json,
|
||||||
|
server::RequestExt,
|
||||||
subreddit::{can_access_quarantine, quarantine},
|
subreddit::{can_access_quarantine, quarantine},
|
||||||
RequestExt,
|
|
||||||
};
|
};
|
||||||
use hyper::{Body, Request, Response};
|
use hyper::{Body, Request, Response};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
@ -3,7 +3,7 @@ use crate::{config, utils};
|
|||||||
use crate::utils::{
|
use crate::utils::{
|
||||||
catch_random, error, filter_posts, format_num, format_url, get_filters, nsfw_landing, param, redirect, rewrite_urls, setting, template, val, Post, Preferences, Subreddit,
|
catch_random, error, filter_posts, format_num, format_url, get_filters, nsfw_landing, param, redirect, rewrite_urls, setting, template, val, Post, Preferences, Subreddit,
|
||||||
};
|
};
|
||||||
use crate::{client::json, server::ResponseExt, RequestExt};
|
use crate::{client::json, server::RequestExt, server::ResponseExt};
|
||||||
use cookie::Cookie;
|
use cookie::Cookie;
|
||||||
use hyper::{Body, Request, Response};
|
use hyper::{Body, Request, Response};
|
||||||
use rinja::Template;
|
use rinja::Template;
|
||||||
|
Loading…
Reference in New Issue
Block a user