Skip to content

Commit

Permalink
fix: fixed wasm issues with ComputedDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
arctic-hen7 committed Jul 12, 2022
1 parent ceaf7b2 commit 247caff
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use perseus::{RenderFnResultWithCause, Template};
use sycamore::prelude::{view, Html, Scope, View};
use std::time::Duration;
use sycamore::prelude::{view, Html, Scope, View};

#[perseus::make_rx(PageStateRx)]
pub struct PageState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// generation (because the two work in complex ways together)

use perseus::{RenderFnResult, RenderFnResultWithCause, Template};
use sycamore::prelude::{view, Html, Scope, View};
use std::time::Duration;
use sycamore::prelude::{view, Html, Scope, View};

#[perseus::make_rx(PageStateRx)]
pub struct PageState {
Expand Down
2 changes: 1 addition & 1 deletion packages/perseus/src/template/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::translator::Translator;
use crate::utils::provide_context_signal_replace;
#[cfg(not(target_arch = "wasm32"))]
use crate::utils::AsyncFnReturn;
#[cfg(not(target_arch = "wasm32"))]
use crate::utils::ComputedDuration;
use crate::Html;
#[cfg(not(target_arch = "wasm32"))]
Expand All @@ -22,7 +23,6 @@ use crate::SsrNode;
use futures::Future;
#[cfg(not(target_arch = "wasm32"))]
use http::header::HeaderMap;
#[cfg(not(target_arch = "wasm32"))]
use std::time::Duration;
use sycamore::prelude::{Scope, View};
#[cfg(not(target_arch = "wasm32"))]
Expand Down
3 changes: 2 additions & 1 deletion packages/perseus/src/utils/decode_time_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ impl TryFrom<&str> for Duration {
fn try_from(value: &str) -> Result<Self, Self::Error> {
let mut duration = Self::default();

// A working variable to store the '123' part of an interval until we reach the indicator and can do the full conversion
// A working variable to store the '123' part of an interval until we reach the
// indicator and can do the full conversion
let mut curr_duration_length = String::new();

for c in value.chars() {
Expand Down

0 comments on commit 247caff

Please sign in to comment.