Replace dependency "chrono" with "time"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
96fbef900e
commit
5832111f46
|
@ -36,9 +36,9 @@ features = ["v4"]
|
||||||
version = "0.4"
|
version = "0.4"
|
||||||
features = ["kv_unstable", "serde", "std", "kv_unstable_serde", "kv_unstable_std"]
|
features = ["kv_unstable", "serde", "std", "kv_unstable_serde", "kv_unstable_std"]
|
||||||
|
|
||||||
[dependencies.chrono]
|
[dependencies.time]
|
||||||
version = "0.4"
|
version = "0.3"
|
||||||
features = ["serde"]
|
features = ["parsing", "serde", "formatting"]
|
||||||
|
|
||||||
[dependencies.envy]
|
[dependencies.envy]
|
||||||
version = "0.4"
|
version = "0.4"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
//! A module containing everything relating to a account returned from the api.
|
//! A module containing everything relating to a account returned from the api.
|
||||||
|
|
||||||
use crate::status_builder;
|
use crate::status_builder;
|
||||||
use chrono::prelude::*;
|
|
||||||
use serde::{
|
use serde::{
|
||||||
de::{self, Deserializer, Unexpected},
|
de::{self, Deserializer, Unexpected},
|
||||||
Deserialize, Serialize,
|
Deserialize, Serialize,
|
||||||
};
|
};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
use time::{serde::iso8601, OffsetDateTime};
|
||||||
|
|
||||||
/// A struct representing an Account.
|
/// A struct representing an Account.
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
||||||
|
@ -18,7 +18,8 @@ pub struct Account {
|
||||||
/// URL to the avatar static image (gif)
|
/// URL to the avatar static image (gif)
|
||||||
pub avatar_static: String,
|
pub avatar_static: String,
|
||||||
/// The time the account was created.
|
/// The time the account was created.
|
||||||
pub created_at: DateTime<Utc>,
|
#[serde(with = "iso8601")]
|
||||||
|
pub created_at: OffsetDateTime,
|
||||||
/// The account's display name.
|
/// The account's display name.
|
||||||
pub display_name: String,
|
pub display_name: String,
|
||||||
/// The number of followers for the account.
|
/// The number of followers for the account.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
//! Module containing all info about notifications.
|
//! Module containing all info about notifications.
|
||||||
|
|
||||||
use super::{account::Account, status::Status};
|
use super::{account::Account, status::Status};
|
||||||
use chrono::prelude::*;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use time::{serde::iso8601, OffsetDateTime};
|
||||||
|
|
||||||
/// A struct containing info about a notification.
|
/// A struct containing info about a notification.
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
|
@ -14,7 +14,8 @@ pub struct Notification {
|
||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
pub notification_type: NotificationType,
|
pub notification_type: NotificationType,
|
||||||
/// The time the notification was created.
|
/// The time the notification was created.
|
||||||
pub created_at: DateTime<Utc>,
|
#[serde(with = "iso8601")]
|
||||||
|
pub created_at: OffsetDateTime,
|
||||||
/// The Account sending the notification to the user.
|
/// The Account sending the notification to the user.
|
||||||
pub account: Account,
|
pub account: Account,
|
||||||
/// The Status associated with the notification, if applicable.
|
/// The Status associated with the notification, if applicable.
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
use super::prelude::*;
|
use super::prelude::*;
|
||||||
use crate::{entities::card::Card, status_builder::Visibility};
|
use crate::{entities::card::Card, status_builder::Visibility};
|
||||||
use chrono::prelude::*;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use time::{serde::iso8601, OffsetDateTime};
|
||||||
|
|
||||||
/// A status from the instance.
|
/// A status from the instance.
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||||
|
@ -28,7 +28,8 @@ pub struct Status {
|
||||||
/// (remote HTML already sanitized)
|
/// (remote HTML already sanitized)
|
||||||
pub content: String,
|
pub content: String,
|
||||||
/// The time the status was created.
|
/// The time the status was created.
|
||||||
pub created_at: DateTime<Utc>,
|
#[serde(with = "iso8601")]
|
||||||
|
pub created_at: OffsetDateTime,
|
||||||
/// An array of Emoji
|
/// An array of Emoji
|
||||||
pub emojis: Vec<Emoji>,
|
pub emojis: Vec<Emoji>,
|
||||||
/// The numbef or replies to this status.
|
/// The numbef or replies to this status.
|
||||||
|
|
Loading…
Reference in New Issue