Fight with warnings
This commit is contained in:
parent
6d0e1fe88c
commit
5013cbfdc0
@ -1,3 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "source-stream-0"
|
name = "source-stream-0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
rust = { nonstandard_style = "allow" }
|
||||||
@ -10,3 +10,6 @@ edition = "2024"
|
|||||||
source-stream-0 = { path = ".." }
|
source-stream-0 = { path = ".." }
|
||||||
source-stream-0-default-streams-0 = { path = "../default-streams" }
|
source-stream-0-default-streams-0 = { path = "../default-streams" }
|
||||||
source-stream-0-converter-0 = { path = "../converter" }
|
source-stream-0-converter-0 = { path = "../converter" }
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
rust = { nonstandard_style = "allow" }
|
||||||
@ -1,5 +1,3 @@
|
|||||||
#![feature(const_for)]
|
|
||||||
|
|
||||||
use crate::{AsciiChar};
|
use crate::{AsciiChar};
|
||||||
|
|
||||||
pub const fn asciiLiteral<const S: usize>(
|
pub const fn asciiLiteral<const S: usize>(
|
||||||
@ -9,7 +7,7 @@ pub const fn asciiLiteral<const S: usize>(
|
|||||||
let mut i = 0usize;
|
let mut i = 0usize;
|
||||||
while i < S {
|
while i < S {
|
||||||
let a = str[i] as u32;
|
let a = str[i] as u32;
|
||||||
if (a >= 128) {
|
if a >= 128 {
|
||||||
panic!("Not ascii char in literal");
|
panic!("Not ascii char in literal");
|
||||||
}
|
}
|
||||||
out[i] = AsciiChar::ASCII(a as u8);
|
out[i] = AsciiChar::ASCII(a as u8);
|
||||||
|
|||||||
@ -6,3 +6,6 @@ edition = "2024"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
source-stream-0 = { path = ".." }
|
source-stream-0 = { path = ".." }
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
rust = { nonstandard_style = "allow" }
|
||||||
@ -170,7 +170,7 @@ pub struct KeywordDeconverted<
|
|||||||
impl<'keyword, 'converter, C, W: StreamConverter_Char<C>, I: Keyword<W::WC>>
|
impl<'keyword, 'converter, C, W: StreamConverter_Char<C>, I: Keyword<W::WC>>
|
||||||
KeywordDeconverted<'keyword, 'converter, C, W, I>
|
KeywordDeconverted<'keyword, 'converter, C, W, I>
|
||||||
{
|
{
|
||||||
fn unwrap(kw: &'keyword I, converter: &'converter W) -> Self {
|
pub fn unwrap(kw: &'keyword I, converter: &'converter W) -> Self {
|
||||||
return KeywordDeconverted {
|
return KeywordDeconverted {
|
||||||
_orig: kw,
|
_orig: kw,
|
||||||
_converter: converter,
|
_converter: converter,
|
||||||
|
|||||||
@ -6,3 +6,6 @@ edition = "2024"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
source-stream-0 = { path = ".." }
|
source-stream-0 = { path = ".." }
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
rust = { nonstandard_style = "allow" }
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use source_stream_0::{CollectedSubstring, Pos, SourceStream};
|
use source_stream_0::{SourceStream};
|
||||||
use crate::iterators::{ArraySourceIterator, StrSourceIterator};
|
use crate::iterators::{ArraySourceIterator};
|
||||||
use crate::pos::{IndexPosCounter, NewLinePosCounter, PosLineCol};
|
use crate::pos::{IndexPosCounter};
|
||||||
use crate::SourceIterator;
|
use crate::SourceIterator;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
use source_stream_0::{CollectResult, CollectedSubstring, Pos};
|
use source_stream_0::{CollectResult, CollectedSubstring, Pos};
|
||||||
use std::marker::PhantomData;
|
|
||||||
|
|
||||||
pub trait PosCounter<'pos, C> {
|
pub trait PosCounter<'pos, C> {
|
||||||
type P: Pos<'pos>;
|
type P: Pos<'pos>;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use crate::_SourceIteratorCollect;
|
use crate::_SourceIteratorCollect;
|
||||||
use crate::iterator::{PosCounter, SourceIterator};
|
use crate::iterator::{PosCounter, SourceIterator};
|
||||||
use source_stream_0::{CollectResult, CollectedSubstring, Keyword, KeywordComparatorIterator, Pos};
|
use source_stream_0::{CollectResult, CollectedSubstring, Keyword, KeywordComparatorIterator};
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::slice::Iter;
|
use std::slice::Iter;
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ pub struct StrSourceIterator<'source, 'pos, PC: PosCounter<'pos, char>> {
|
|||||||
_posRaw: usize,
|
_posRaw: usize,
|
||||||
_posCodePoints: usize,
|
_posCodePoints: usize,
|
||||||
_posHighlevel: PC,
|
_posHighlevel: PC,
|
||||||
__phantom: PhantomData<(&'pos ())>,
|
__phantom: PhantomData<&'pos ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'source, 'pos, PC: PosCounter<'pos, char>> StrSourceIterator<'source, 'pos, PC> {
|
impl<'source, 'pos, PC: PosCounter<'pos, char>> StrSourceIterator<'source, 'pos, PC> {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ impl Default for IndexPosCounter {
|
|||||||
impl<C> PosCounter<'static, C> for IndexPosCounter {
|
impl<C> PosCounter<'static, C> for IndexPosCounter {
|
||||||
type P = usize;
|
type P = usize;
|
||||||
|
|
||||||
fn update(&mut self, c: C) {
|
fn update(&mut self, _: C) {
|
||||||
self.index += 1;
|
self.index += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
use std::marker::PhantomData;
|
|
||||||
use crate::iterator::PosCounter;
|
use crate::iterator::PosCounter;
|
||||||
use source_stream_0::Pos;
|
use source_stream_0::Pos;
|
||||||
use crate::pos::IndexPosCounter;
|
|
||||||
|
|
||||||
pub struct PosLineCol {
|
pub struct PosLineCol {
|
||||||
pub row: usize,
|
pub row: usize,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ impl Default for NopPosCounter {
|
|||||||
impl<C> PosCounter<'static, C> for NopPosCounter {
|
impl<C> PosCounter<'static, C> for NopPosCounter {
|
||||||
type P = ();
|
type P = ();
|
||||||
|
|
||||||
fn update(&mut self, c: C) {}
|
fn update(&mut self, _: C) {}
|
||||||
|
|
||||||
fn export(&self) {}
|
fn export(&self) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use crate::_SourceIteratorCollect;
|
use crate::_SourceIteratorCollect;
|
||||||
use crate::iterator::SourceIterator;
|
use crate::iterator::SourceIterator;
|
||||||
use source_stream_0::{CollectResult, CollectedSubstring, Predicate, SourceStream};
|
use source_stream_0::{CollectResult, Predicate, SourceStream};
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
pub struct SourceStreamOverIterator<'source, 'pos, I: SourceIterator<'source, 'pos>> {
|
pub struct SourceStreamOverIterator<'source, 'pos, I: SourceIterator<'source, 'pos>> {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ impl crate::Keyword<char> for &str {
|
|||||||
&'keyword self,
|
&'keyword self,
|
||||||
expectedLen: usize,
|
expectedLen: usize,
|
||||||
) -> Option<impl crate::KeywordComparatorIterator<'keyword, char>> {
|
) -> Option<impl crate::KeywordComparatorIterator<'keyword, char>> {
|
||||||
if (self.len() != expectedLen) {
|
if self.len() != expectedLen {
|
||||||
return Option::None;
|
return Option::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ impl crate::Keyword<char> for &String {
|
|||||||
&'keyword self,
|
&'keyword self,
|
||||||
expectedLen: usize,
|
expectedLen: usize,
|
||||||
) -> Option<impl crate::KeywordComparatorIterator<'keyword, char>> {
|
) -> Option<impl crate::KeywordComparatorIterator<'keyword, char>> {
|
||||||
if (self.len() != expectedLen) {
|
if self.len() != expectedLen {
|
||||||
return Option::None;
|
return Option::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ impl<C: PartialEq> crate::Keyword<C> for &[C] {
|
|||||||
&'keyword self,
|
&'keyword self,
|
||||||
expectedLen: usize,
|
expectedLen: usize,
|
||||||
) -> Option<impl crate::KeywordComparatorIterator<'keyword, C>> {
|
) -> Option<impl crate::KeywordComparatorIterator<'keyword, C>> {
|
||||||
if (self.len() != expectedLen) {
|
if self.len() != expectedLen {
|
||||||
return Option::None;
|
return Option::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ impl<C: PartialEq, const SZ: usize> crate::Keyword<C> for &[C; SZ] {
|
|||||||
&'keyword self,
|
&'keyword self,
|
||||||
expectedLen: usize,
|
expectedLen: usize,
|
||||||
) -> Option<impl crate::KeywordComparatorIterator<'keyword, C>> {
|
) -> Option<impl crate::KeywordComparatorIterator<'keyword, C>> {
|
||||||
if (self.len() != expectedLen) {
|
if self.len() != expectedLen {
|
||||||
return Option::None;
|
return Option::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user