mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 11:31:06 +00:00
gstreamer/datetime: Update for glib::DateTime API changes
This commit is contained in:
parent
60a5ccc95d
commit
ec2a287842
1 changed files with 2 additions and 8 deletions
|
@ -296,10 +296,7 @@ impl DateTime {
|
||||||
// however, the resulting instance can't be translated to `glib::DateTime`
|
// however, the resulting instance can't be translated to `glib::DateTime`
|
||||||
if self.has_second() {
|
if self.has_second() {
|
||||||
self.to_g_date_time()
|
self.to_g_date_time()
|
||||||
.and_then(|d| {
|
.and_then(|d| d.to_utc())
|
||||||
d.to_utc()
|
|
||||||
.ok_or_else(|| glib::bool_error!("Can't convert datetime to UTC"))
|
|
||||||
})
|
|
||||||
.map(|d| d.into())
|
.map(|d| d.into())
|
||||||
} else {
|
} else {
|
||||||
// It would be cheaper to build a `glib::DateTime` direcly, unfortunetaly
|
// It would be cheaper to build a `glib::DateTime` direcly, unfortunetaly
|
||||||
|
@ -316,10 +313,7 @@ impl DateTime {
|
||||||
Some(0.0),
|
Some(0.0),
|
||||||
)
|
)
|
||||||
.and_then(|d| d.to_g_date_time())
|
.and_then(|d| d.to_g_date_time())
|
||||||
.and_then(|d| {
|
.and_then(|d| d.to_utc())
|
||||||
d.to_utc()
|
|
||||||
.ok_or_else(|| glib::bool_error!("Can't convert datetime to UTC"))
|
|
||||||
})
|
|
||||||
.and_then(|d| {
|
.and_then(|d| {
|
||||||
DateTime::new(
|
DateTime::new(
|
||||||
None, // UTC TZ offset
|
None, // UTC TZ offset
|
||||||
|
|
Loading…
Reference in a new issue