pub fn y(self) -> T { self.coords[1] }
}
+#[allow(clippy::should_implement_trait)] // this one is fallible, which is a bit odd
impl<T> PosC<T> {
#[throws(PosCFromIteratorError)]
pub fn from_iter<I: Iterator<Item=T>>(i: I) -> Self { PosC{ coords:
impl Html {
pub fn new() -> Self { default() }
pub fn from_txt(s: &str) -> Self {
- Html(htmlescape::encode_minimal(&s))
+ Html(htmlescape::encode_minimal(s))
}
pub fn from_html_string(s: String) -> Self { Html(s) }
let s = unsafe { mem::transmute::<&'s str, &'s HtmlStr>(s) };
s
}
+ #[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> usize { self.0.len() }
pub fn as_html_str(&self) -> &str { &self.0 }
}
/// return value is the top bits, shifted
pub fn to_str_buf(self, out: &mut [Tail1; DIGITS_PER_LIMB]) -> LimbVal {
let mut l = self;
- for p in out.into_iter().rev() {
+ for p in out.iter_mut().rev() {
let v = (l & DIGIT_MASK).primitive() as u8;
*p = if v < 10 { b'0' + v } else { (b'a' - 10) + v };
l >>= BITS_PER_DIGIT;
match (a, b) {
(None, None ) => throw!(TotallyUnboundedRange),
(Some(a), None ) => mk( a.clone().iter(Increment).take(c) ),
- (Some(a), Some(b)) => mk( Mutable::range_upto(&a,&b,count)? ),
+ (Some(a), Some(b)) => mk( Mutable::range_upto(a,b,count)? ),
(None, Some(b)) => mk({
let mut first = b.clone();
first.addsub(&Decrement).unwrap();
- let (current, aso) = Mutable::range_core(&first, &b, count-1)?;
+ let (current, aso) = Mutable::range_core(&first, b, count-1)?;
IteratorCore { current, aso, mr: MutateLast }.take(c)
}),
}