Compare commits
9 Commits
8d0c48ae0f
...
90feca00b6
| Author | SHA1 | Date | |
|---|---|---|---|
|
90feca00b6
|
|||
|
71e413b986
|
|||
|
12d70664a4
|
|||
|
607da348af
|
|||
|
25ebcd10da
|
|||
|
f86b1dbf84
|
|||
|
8fabd409ad
|
|||
|
031dd71cf3
|
|||
|
a8e2bfbb3c
|
@@ -1,3 +1,4 @@
|
|||||||
|
#![deny(unused_imports)]
|
||||||
#![allow(clippy::missing_safety_doc)]
|
#![allow(clippy::missing_safety_doc)]
|
||||||
|
|
||||||
use core::slice;
|
use core::slice;
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
|
#![deny(unused_imports)]
|
||||||
|
|
||||||
use core::slice;
|
use core::slice;
|
||||||
use gentoo_utils::{
|
use gentoo_utils::{Parseable, atom::Version};
|
||||||
Parseable,
|
use mon::{Parser, input::InputIter};
|
||||||
atom::{Atom, Version},
|
|
||||||
};
|
|
||||||
use mon::{Parser, ParserFinishedError, input::InputIter};
|
|
||||||
use std::{
|
use std::{
|
||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
io::{BufRead, BufReader, Write},
|
io::{BufRead, BufReader, Write},
|
||||||
|
|||||||
1
rust-project.json
Symbolic link
1
rust-project.json
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
build/rust-project.json
|
||||||
@@ -646,14 +646,6 @@ mod test {
|
|||||||
|
|
||||||
use crate::Parseable;
|
use crate::Parseable;
|
||||||
|
|
||||||
macro_rules! assert_eq_display {
|
|
||||||
($a:expr, $b:expr) => {
|
|
||||||
if $a != $b {
|
|
||||||
panic!("{} != {}", $a, $b);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! assert_cmp_display {
|
macro_rules! assert_cmp_display {
|
||||||
($a:expr, $b:expr, $ordering:expr) => {
|
($a:expr, $b:expr, $ordering:expr) => {
|
||||||
if $a.cmp(&$b) != $ordering {
|
if $a.cmp(&$b) != $ordering {
|
||||||
@@ -768,6 +760,7 @@ mod test {
|
|||||||
.parse_finished(InputIter::new("1.2.0a_alpha1_beta2-r1-8"))
|
.parse_finished(InputIter::new("1.2.0a_alpha1_beta2-r1-8"))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
#[allow(clippy::single_element_loop)]
|
||||||
for (version_str, expected) in [("1.2.0", Ordering::Greater)] {
|
for (version_str, expected) in [("1.2.0", Ordering::Greater)] {
|
||||||
let version = Version::parser()
|
let version = Version::parser()
|
||||||
.parse_finished(InputIter::new(version_str))
|
.parse_finished(InputIter::new(version_str))
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ pub enum Error {
|
|||||||
pub struct Profile {
|
pub struct Profile {
|
||||||
#[get(kind = "deref")]
|
#[get(kind = "deref")]
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
eapi: Option<Eapi>,
|
eapi: Eapi,
|
||||||
deprecated: Option<String>,
|
deprecated: Option<String>,
|
||||||
#[get(kind = "deref")]
|
#[get(kind = "deref")]
|
||||||
parents: Vec<Profile>,
|
parents: Vec<Profile>,
|
||||||
@@ -108,9 +108,9 @@ impl Profile {
|
|||||||
let eapi = match fs::read_to_string(&eapi_path)
|
let eapi = match fs::read_to_string(&eapi_path)
|
||||||
.map(|s| Eapi::parse(s.trim()).map_err(str::to_string))
|
.map(|s| Eapi::parse(s.trim()).map_err(str::to_string))
|
||||||
{
|
{
|
||||||
Ok(Ok(eapi)) => Some(eapi),
|
Ok(Ok(eapi)) => eapi,
|
||||||
Ok(Err(rest)) => return Err(Error::Parser(rest)),
|
Ok(Err(rest)) => return Err(Error::Parser(rest)),
|
||||||
Err(e) if matches!(e.kind(), io::ErrorKind::NotFound) => None,
|
Err(e) if matches!(e.kind(), io::ErrorKind::NotFound) => Eapi::parse("0").unwrap(),
|
||||||
Err(e) => return Err(Error::Io(eapi_path, e)),
|
Err(e) => return Err(Error::Io(eapi_path, e)),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user