matrix-sdk: Use the instant crate so Instant works on wasm as well.

master
Damir Jelić 2020-05-12 14:28:01 +02:00 committed by stoically
parent 19b8a1686d
commit 2a411bf5df
5 changed files with 6 additions and 4 deletions

View File

@ -19,8 +19,8 @@ use std::collections::HashMap;
use std::convert::{TryFrom, TryInto}; use std::convert::{TryFrom, TryInto};
use std::result::Result as StdResult; use std::result::Result as StdResult;
use std::sync::Arc; use std::sync::Arc;
use std::time::{Duration, Instant};
use matrix_sdk_common::instant::{Duration, Instant};
use matrix_sdk_common::locks::RwLock; use matrix_sdk_common::locks::RwLock;
use matrix_sdk_common::uuid::Uuid; use matrix_sdk_common::uuid::Uuid;

View File

@ -16,6 +16,7 @@ ruma-api = "0.16.0"
ruma-client-api = "0.8.0" ruma-client-api = "0.8.0"
ruma-events = "0.21.0" ruma-events = "0.21.0"
ruma-identifiers = "0.16.1" ruma-identifiers = "0.16.1"
instant = { version = "0.1.3", features = ["wasm-bindgen", "now"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
uuid = { version = "0.8.1", features = ["v4"] } uuid = { version = "0.8.1", features = ["v4"] }

View File

@ -1,3 +1,4 @@
pub use instant;
pub use js_int; pub use js_int;
pub use ruma_api::{ pub use ruma_api::{
error::{FromHttpResponseError, IntoHttpError, ServerError}, error::{FromHttpResponseError, IntoHttpError, ServerError},

View File

@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use matrix_sdk_common::instant::Instant;
use std::fmt; use std::fmt;
use std::mem; use std::mem;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc; use std::sync::Arc;
use std::time::Instant;
use matrix_sdk_common::locks::Mutex; use matrix_sdk_common::locks::Mutex;
use serde::Serialize; use serde::Serialize;

View File

@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use matrix_sdk_common::instant::{Duration, Instant};
use std::collections::{BTreeMap, HashSet}; use std::collections::{BTreeMap, HashSet};
use std::convert::TryFrom; use std::convert::TryFrom;
use std::mem; use std::mem;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::result::Result as StdResult; use std::result::Result as StdResult;
use std::sync::Arc; use std::sync::Arc;
use std::time::{Duration, Instant};
use url::Url; use url::Url;
use async_trait::async_trait; use async_trait::async_trait;