Skip to content

Commit

Permalink
fix: fix SyncLazy rename to LazyLock rust-lang/rust#98165
Browse files Browse the repository at this point in the history
  • Loading branch information
HerringtonDarkholme committed Jul 1, 2022
1 parent 7bdf625 commit 94c4a47
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions crates/compiler/src/converter/v_for.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ mod test {
use super::*;
use crate::cast;
fn to_str(e: Js) -> &str {
let v = cast!(e, Js::Param);
v
cast!(e, Js::Param)
}
fn check_equal(src: &str, expect: (&str, &str, Option<&str>, Option<&str>)) {
let (src, ret) = parse_for_expr(VStr::raw(src)).expect("should parse");
Expand Down
2 changes: 1 addition & 1 deletion crates/compiler/src/transformer/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ macro_rules! chain_exit_ext {
}
};
}
impl<'b, T, A, B, Shared> CorePassExt<T, Shared> for Chain<A, B>
impl<T, A, B, Shared> CorePassExt<T, Shared> for Chain<A, B>
where
T: ConvertInfo,
A: CorePassExt<T, Shared>,
Expand Down
6 changes: 3 additions & 3 deletions crates/compiler/src/util/decode_html.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// sadly current html decode crate requires std::io::Write not fmt
use std::fmt::{self, Write};
use super::named_chars::NAMED_CHAR_REF;
use std::lazy::SyncLazy;
use std::sync::LazyLock;

static MAX_CR_NAME_LEN: SyncLazy<usize> =
SyncLazy::new(|| NAMED_CHAR_REF.keys().copied().map(str::len).max().unwrap());
static MAX_CR_NAME_LEN: LazyLock<usize> =
LazyLock::new(|| NAMED_CHAR_REF.keys().copied().map(str::len).max().unwrap());

type DecodeResult<'a> = Result<&'a str, fmt::Error>;
pub fn decode_entities<W: Write>(s: &str, mut w: W, as_attr: bool) -> fmt::Result {
Expand Down
4 changes: 2 additions & 2 deletions crates/dom/src/converter/v_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ pub fn convert_v_model<'a>(
DirectiveConvertResult::Dropped | DirectiveConvertResult::Preserve => return base,
DirectiveConvertResult::Converted { value, runtime } => (value, runtime),
};
let runtime_to_use = match compute_v_model_runtime(e, dir) {
match compute_v_model_runtime(e, dir) {
Ok(rt) => {
if matches!(rt, dh::V_MODEL_TEXT | dh::V_MODEL_SELECT) {
check_redundant_value_prop(e, eh);
}
*runtime = Ok(rt);
}
Err(error) => eh.on_error(error),
};
}
// native vmodel doesn't need the `modelValue` props since they are also
// passed to the runtime as `binding.value`. removing it reduces code size.
let props = cast!(value, Js::Props);
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2022-01-01
nightly-2022-06-30

0 comments on commit 94c4a47

Please sign in to comment.