Switch of several config attributes to pub(crate)
This commit is contained in:
parent
dd11620ffa
commit
5ddb6b3b75
1 changed files with 15 additions and 14 deletions
|
@ -1,12 +1,13 @@
|
||||||
use std::{error::Error};
|
use std::{error::Error};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
|
use crate::config::PostBody::Description;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub(crate) struct Config {
|
pub(crate) struct Config {
|
||||||
instance: String,
|
pub(crate) instance: String,
|
||||||
status_post_url: Option<String>,
|
pub(crate) status_post_url: Option<String>,
|
||||||
config_reload_seconds: u32,
|
pub(crate) config_reload_seconds: u32,
|
||||||
series: Vec<SeriesConfig>,
|
pub(crate) series: Vec<SeriesConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
|
@ -40,26 +41,26 @@ impl Default for Config {
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub(crate) struct SeriesConfig {
|
pub(crate) struct SeriesConfig {
|
||||||
slug: String,
|
pub(crate) slug: String,
|
||||||
parted: bool,
|
pub(crate) parted: bool,
|
||||||
prepub_community: PostConfig,
|
pub(crate) prepub_community: PostConfig,
|
||||||
volume_community: PostConfig,
|
pub(crate) volume_community: PostConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub(crate) struct PostConfig {
|
pub(crate) struct PostConfig {
|
||||||
community_name: String,
|
pub(crate) community_name: String,
|
||||||
pin_settings: PinConfig,
|
pub(crate) pin_settings: PinConfig,
|
||||||
post_body: PostBody,
|
pub(crate) post_body: PostBody,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
pub(crate) struct PinConfig {
|
pub(crate) struct PinConfig {
|
||||||
pin_new_post_local: bool,
|
pub(crate) pin_new_post_local: bool,
|
||||||
pin_new_post_community: bool,
|
pub(crate) pin_new_post_community: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
|
||||||
#[serde(tag = "body_type", content = "body_content")]
|
#[serde(tag = "body_type", content = "body_content")]
|
||||||
pub(crate) enum PostBody {
|
pub(crate) enum PostBody {
|
||||||
None,
|
None,
|
||||||
|
|
Loading…
Reference in a new issue