difftreelog
feat impl Borrow for IStr/IBytes
in: master
2 files changed
crates/jrsonnet-interner/src/lib.rsdiffbeforeafterboth6#![warn(clippy::pedantic, clippy::nursery)]6#![warn(clippy::pedantic, clippy::nursery)]7#![allow(clippy::missing_const_for_fn)]7#![allow(clippy::missing_const_for_fn)]8use std::{8use std::{9 borrow::Cow,9 borrow::{Borrow, Cow},10 cell::RefCell,10 cell::RefCell,11 fmt::{self, Display},11 fmt::{self, Display},12 hash::{BuildHasherDefault, Hash, Hasher},12 hash::{BuildHasherDefault, Hash, Hasher},57 }57 }58}58}5960impl Borrow<str> for IStr {61 fn borrow(&self) -> &str {62 self.as_str()63 }64}65impl Borrow<[u8]> for IStr {66 fn borrow(&self) -> &[u8] {67 self.as_bytes()68 }69}597060impl PartialEq for IStr {71impl PartialEq for IStr {61 fn eq(&self, other: &Self) -> bool {72 fn eq(&self, other: &Self) -> bool {135 }146 }136}147}148149impl Borrow<[u8]> for IBytes {150 fn borrow(&self) -> &[u8] {151 self.0.as_slice()152 }153}137154138impl PartialEq for IBytes {155impl PartialEq for IBytes {139 fn eq(&self, other: &Self) -> bool {156 fn eq(&self, other: &Self) -> bool {crates/jrsonnet-stdlib/src/misc.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/misc.rs
+++ b/crates/jrsonnet-stdlib/src/misc.rs
@@ -3,6 +3,7 @@
use jrsonnet_evaluator::{
error::{ErrorKind::*, Result},
function::{builtin, ArgLike, CallLocation, FuncVal},
+ manifest::JsonFormat,
throw,
typed::{Either2, Either4},
val::{equals, ArrValue},