Skip to content

Commit

Permalink
Set Rust edition 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokosi committed Mar 3, 2025
1 parent 5b3f1ca commit 12b8fe7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords = ["github", "cli", "pull-request", "summary"]
categories = ["cli", "cli-tools"]
license = "MIT"
authors = ["Nicolas Kosinski <[email protected]>"]
edition = "2021"
edition = "2024"

[dependencies]
log = "0.4"
Expand Down
13 changes: 7 additions & 6 deletions src/github_events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ pub(crate) fn github_events(repo: &str, token: &Option<String>) -> Result<Vec<Ra
debug!("Content found for {:?} (page number: {})", repo, page);
trace!(
"Content found for {:?} (page number: {}): {:?}",
repo,
page,
body
repo, page, body
);
body
}
Expand Down Expand Up @@ -223,21 +221,24 @@ mod tests {
#[test]
fn parse_github_link_header_for_page_1_over_10() {
let last_page = last_page_from_link_header(
"<https://api.github.com/repositories/257951013/events?page=2>; rel=\"next\", <https://api.github.com/repositories/257951013/events?page=10>; rel=\"last\"");
"<https://api.github.com/repositories/257951013/events?page=2>; rel=\"next\", <https://api.github.com/repositories/257951013/events?page=10>; rel=\"last\"",
);
assert_eq!(last_page, Some(10));
}

#[test]
fn parse_github_link_header_for_page_2_over_10() {
let last_page = last_page_from_link_header(
"<https://api.github.com/repositories/257951013/events?page=1>; rel=\"prev\", <https://api.github.com/repositories/257951013/events?page=3>; rel=\"next\", <https://api.github.com/repositories/257951013/events?page=10>; rel=\"last\", <https://api.github.com/repositories/257951013/events?page=1>; rel=\"first\"");
"<https://api.github.com/repositories/257951013/events?page=1>; rel=\"prev\", <https://api.github.com/repositories/257951013/events?page=3>; rel=\"next\", <https://api.github.com/repositories/257951013/events?page=10>; rel=\"last\", <https://api.github.com/repositories/257951013/events?page=1>; rel=\"first\"",
);
assert_eq!(last_page, Some(10));
}

#[test]
fn parse_github_link_header_for_page_10_over_10() {
let last_page = last_page_from_link_header(
"<https://api.github.com/repositories/257951013/events?page=9>; rel=\"prev\", <https://api.github.com/repositories/257951013/events?page=1>; rel=\"first\"");
"<https://api.github.com/repositories/257951013/events?page=9>; rel=\"prev\", <https://api.github.com/repositories/257951013/events?page=1>; rel=\"first\"",
);
assert_eq!(last_page, None);
}

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use serde::Deserialize;
use serde::Serialize;
use structopt::StructOpt;

use crate::github_events::{github_events as _github_events, Action, RawEvent, Type};
use crate::github_events::{Action, RawEvent, Type, github_events as _github_events};

pub mod github_events;

Expand Down Expand Up @@ -153,11 +153,11 @@ mod tests {

use chrono::{TimeZone, Utc};

use crate::Config;
use crate::OsString;
use crate::config_from_args;
use crate::events_per_author;
use crate::print_events_per_author;
use crate::Config;
use crate::OsString;

use super::github_events::*;

Expand Down

0 comments on commit 12b8fe7

Please sign in to comment.