right-as 0.1.0

Chain call assigns tuple elements to outside
Documentation
  • Coverage
  • 57.14%
    4 out of 7 items documented2 out of 4 items with examples
  • Size
  • Source code size: 5.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 780.25 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • A4-Tacks/right-as-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • A4-Tacks

Chain call assigns tuple elements to outside

Examples

use right_as::TupleExt;

let mut right = "";
let left = "left,right"
    .split_once(',')
    .unwrap()
    .right_as(&mut right);

assert_eq!(left, "left");
assert_eq!(right, "right");
use right_as::TupleExt;

let [b, c] = &mut [0; 2];
let a = Some(1)
    .zip(Some(2))
    .zip(Some(3))
    .right_as(c)
    .right_as(b);

assert_eq!(a, Some(1));
assert_eq!(b, &mut 2);
assert_eq!(c, &mut 3);
use right_as::TupleExt;

let mut right = None;
let left = "left,right"
    .split_once(',')
    .unwrap()
    .right_as(&mut right);

assert_eq!(left, "left");
assert_eq!(right, Some("right"));
use right_as::TupleExt;

let mut right = "";
let left = "left,right"
    .split_once(',')
    .right_as(&mut right);

assert_eq!(left, Some("left"));
assert_eq!(right, "right");
use right_as::TupleExt;

let mut right = "";
let left = "left"
    .split_once(',')
    .right_as(&mut right);

assert_eq!(left, None);
assert_eq!(right, "");