summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/xtask
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rust-analyzer/xtask')
-rw-r--r--src/tools/rust-analyzer/xtask/Cargo.toml1
-rw-r--r--src/tools/rust-analyzer/xtask/src/dist.rs9
-rw-r--r--src/tools/rust-analyzer/xtask/src/publish.rs2
-rw-r--r--src/tools/rust-analyzer/xtask/src/release/changelog.rs4
4 files changed, 11 insertions, 5 deletions
diff --git a/src/tools/rust-analyzer/xtask/Cargo.toml b/src/tools/rust-analyzer/xtask/Cargo.toml
index 2dd01796c..b4b294c30 100644
--- a/src/tools/rust-analyzer/xtask/Cargo.toml
+++ b/src/tools/rust-analyzer/xtask/Cargo.toml
@@ -12,5 +12,6 @@ flate2 = "1.0.24"
write-json = "0.1.2"
xshell = "0.2.2"
xflags = "0.3.0"
+time = { version = "0.3", default-features = false }
zip = { version = "0.6", default-features = false, features = ["deflate", "time"] }
# Avoid adding more dependencies to this crate
diff --git a/src/tools/rust-analyzer/xtask/src/dist.rs b/src/tools/rust-analyzer/xtask/src/dist.rs
index 74715c53e..5a03c71b2 100644
--- a/src/tools/rust-analyzer/xtask/src/dist.rs
+++ b/src/tools/rust-analyzer/xtask/src/dist.rs
@@ -6,6 +6,7 @@ use std::{
};
use flate2::{write::GzEncoder, Compression};
+use time::OffsetDateTime;
use xshell::{cmd, Shell};
use zip::{write::FileOptions, DateTime, ZipWriter};
@@ -112,7 +113,8 @@ fn zip(src_path: &Path, symbols_path: Option<&PathBuf>, dest_path: &Path) -> any
src_path.file_name().unwrap().to_str().unwrap(),
FileOptions::default()
.last_modified_time(
- DateTime::from_time(std::fs::metadata(src_path)?.modified()?.into()).unwrap(),
+ DateTime::try_from(OffsetDateTime::from(std::fs::metadata(src_path)?.modified()?))
+ .unwrap(),
)
.unix_permissions(0o755)
.compression_method(zip::CompressionMethod::Deflated)
@@ -125,7 +127,10 @@ fn zip(src_path: &Path, symbols_path: Option<&PathBuf>, dest_path: &Path) -> any
symbols_path.file_name().unwrap().to_str().unwrap(),
FileOptions::default()
.last_modified_time(
- DateTime::from_time(std::fs::metadata(src_path)?.modified()?.into()).unwrap(),
+ DateTime::try_from(OffsetDateTime::from(
+ std::fs::metadata(src_path)?.modified()?,
+ ))
+ .unwrap(),
)
.compression_method(zip::CompressionMethod::Deflated)
.compression_level(Some(9)),
diff --git a/src/tools/rust-analyzer/xtask/src/publish.rs b/src/tools/rust-analyzer/xtask/src/publish.rs
index 79b5f3d2f..cdb7d8fac 100644
--- a/src/tools/rust-analyzer/xtask/src/publish.rs
+++ b/src/tools/rust-analyzer/xtask/src/publish.rs
@@ -13,7 +13,7 @@ impl flags::PublishReleaseNotes {
let tag_name = &file_name[0..10];
let original_changelog_url = create_original_changelog_url(&file_name);
let additional_paragraph =
- format!("\nSee also [original changelog]({original_changelog_url}).");
+ format!("\nSee also the [changelog post]({original_changelog_url}).");
markdown.push_str(&additional_paragraph);
if self.dry_run {
println!("{markdown}");
diff --git a/src/tools/rust-analyzer/xtask/src/release/changelog.rs b/src/tools/rust-analyzer/xtask/src/release/changelog.rs
index d2a1483e3..675384148 100644
--- a/src/tools/rust-analyzer/xtask/src/release/changelog.rs
+++ b/src/tools/rust-analyzer/xtask/src/release/changelog.rs
@@ -69,7 +69,7 @@ pub(crate) fn get_changelog(
:page-layout: post
Commit: commit:{commit}[] +
-Release: release:{today}[]
+Release: release:{today}[] (`TBD`)
== New Features
@@ -156,7 +156,7 @@ fn parse_title_line(s: &str) -> PrInfo {
("minor: ", PrKind::Skip),
];
- for &(prefix, kind) in &PREFIXES {
+ for (prefix, kind) in PREFIXES {
if lower.starts_with(prefix) {
let message = match &kind {
PrKind::Skip => None,