Skip to content

Commit 7955547

Browse files
fix dependency not working with rustc 1.78 (#3890)
1 parent 93e862b commit 7955547

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

Cargo.lock

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/yew-router/src/router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn base_router(props: &RouterProps) -> Html {
8787
history.clone(),
8888
old_basename.as_ref().or(basename.as_ref()).cloned(),
8989
);
90-
*old_basename = basename.clone();
90+
old_basename.clone_from(&basename);
9191
let location = history.location();
9292
let stripped = old_navigator.strip_basename(Cow::from(location.path()));
9393
let prefixed = navigator.prefix_basename(&stripped);

tools/website-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55
build = "build.rs"
66
publish = false
7-
rust-version = "1.81"
7+
rust-version = "1.78"
88

99
[dependencies]
1010
yew-agent = { path = "../../packages/yew-agent/" }

tools/website-test/build.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ fn should_combine_code_blocks(path: &Path) -> io::Result<bool> {
4040
}
4141
let mut buf = [0u8; 32];
4242
file.read_exact(&mut buf)?;
43-
Ok(buf.trim_ascii_end().ends_with(FLAG))
43+
// TODO: Use trim_ascii_end() when MSRV is updated to 1.80+
44+
let trimmed = buf
45+
.iter()
46+
.rposition(|&b| !b.is_ascii_whitespace())
47+
.map(|i| &buf[..=i])
48+
.unwrap_or(&buf[..0]);
49+
Ok(trimmed.ends_with(FLAG))
4450
}
4551

4652
fn apply_diff(src: &mut String, preamble: &str, added: &str, removed: &str) -> Result {
@@ -117,7 +123,8 @@ fn combined_code_blocks(path: &Path) -> Result<String> {
117123
}
118124
removed += line;
119125
removed += "\n";
120-
} else if line.trim_ascii() == "// ..." {
126+
// TODO: Use trim_ascii() when MSRV is updated to 1.80+
127+
} else if line.trim() == "// ..." {
121128
// disregard the preamble
122129
preamble.clear();
123130
} else {

0 commit comments

Comments
 (0)