release: 0.9.0 - import, export, rust upgrade

This commit is contained in:
xeruf 2025-01-21 23:07:53 +01:00
parent eb1bafad2d
commit d6d9a876a3
5 changed files with 8 additions and 9 deletions

2
Cargo.lock generated
View file

@ -1543,7 +1543,7 @@ dependencies = [
[[package]] [[package]]
name = "mostr" name = "mostr"
version = "0.8.0" version = "0.9.0"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"chrono", "chrono",

View file

@ -5,7 +5,7 @@ repository = "https://forge.ftt.gmbh/janek/mostr"
readme = "README.md" readme = "README.md"
license = "GPL 3.0" license = "GPL 3.0"
authors = ["melonion"] authors = ["melonion"]
version = "0.8.0" version = "0.9.0"
rust-version = "1.82" rust-version = "1.82"
edition = "2021" edition = "2021"
default-run = "mostr" default-run = "mostr"

View file

@ -1,2 +1,2 @@
[toolchain] [toolchain]
channel = "1.82.0" channel = "1.84.0"

View file

@ -134,10 +134,8 @@ pub fn format_as_datetime<F>(stamp: &Timestamp, formatter: F) -> String
where where
F: Fn(DateTime<Local>) -> String, F: Fn(DateTime<Local>) -> String,
{ {
match Local.timestamp_opt(stamp.as_u64() as i64 + 1, 0) { Local.timestamp_opt(stamp.as_u64() as i64 + 1, 0).earliest()
Single(time) => formatter(time), .map_or_else(|| stamp.to_human_datetime().to_string(), formatter)
_ => stamp.to_human_datetime().to_string(),
}
} }
/// Format nostr Timestamp relative to local time /// Format nostr Timestamp relative to local time

View file

@ -683,7 +683,7 @@ async fn main() -> Result<()> {
None => tasks.move_to(None), None => tasks.move_to(None),
Some(arg) => { Some(arg) => {
let pos = tasks.get_position_timestamped(); let pos = tasks.get_position_timestamped();
let time = pos.1.and_then(|_| Local.timestamp_millis_opt(pos.0.as_u64() as i64 * 1000).earliest()); let time = pos.1.and_then(|_| Local.timestamp_opt(pos.0.as_u64() as i64, 0).earliest());
if parse_tracking_stamp(arg, time) if parse_tracking_stamp(arg, time)
.and_then(|stamp| tasks.track_at(stamp, None)).is_some() { .and_then(|stamp| tasks.track_at(stamp, None)).is_some() {
println!("{}", tasks.times_tracked(15)); println!("{}", tasks.times_tracked(15));
@ -714,7 +714,8 @@ async fn main() -> Result<()> {
tasks.set_view_depth(depth); tasks.set_view_depth(depth);
} }
_ => { _ => {
tasks.filter_or_create(pos, &remaining).map(|id| tasks.move_to(Some(id))); tasks.filter_or_create(pos, &remaining)
.map(|id| tasks.move_to(Some(id)));
} }
} }
} }