Skip to content

Commit

Permalink
chore: bump yang3 to 0.12
Browse files Browse the repository at this point in the history
Signed-off-by: Renato Westphal <[email protected]>
  • Loading branch information
rwestphal committed Jan 9, 2025
1 parent bbbfb72 commit 37114c3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ tonic = { version = "0.12", features = ["tls"] }
tonic-build = "0.12"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
yang3 = { version = "0.9", features = ["bundled"] }
yang3 = { version = "0.12", features = ["bundled"] }

[workspace.lints.rust]
rust_2018_idioms = { level = "warn", priority = -1 }
Expand Down
2 changes: 1 addition & 1 deletion holo-northbound/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl<'a> StructBuilder<'a> {
// into_data_node() function implementation.
writeln!(
output,
"{}fn into_data_node(self: Box<Self>, dnode: &mut DataNodeRef<'_, '_>) {{",
"{}fn into_data_node(self: Box<Self>, dnode: &mut DataNodeRef<'_>) {{",
indent2
)
.unwrap();
Expand Down
8 changes: 4 additions & 4 deletions holo-northbound/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct CallbackArgs<'a, P: Provider> {
pub resource: &'a mut Option<P::Resource>,
pub old_config: &'a Arc<DataTree<'static>>,
pub new_config: &'a Arc<DataTree<'static>>,
pub dnode: DataNodeRef<'a, 'static>,
pub dnode: DataNodeRef<'a>,
}

//
Expand All @@ -80,7 +80,7 @@ pub struct ValidationCallbacksBuilder {

#[derive(Debug)]
pub struct ValidationCallbackArgs<'a> {
pub dnode: DataNodeRef<'a, 'static>,
pub dnode: DataNodeRef<'a>,
}

//
Expand All @@ -93,7 +93,7 @@ pub type ConfigChanges = Vec<ConfigChange>;
pub type CallbackLookup<P: Provider> = for<'a> fn(
&'a mut P,
list_entry: P::ListEntry,
dnode: DataNodeRef<'a, 'static>,
dnode: DataNodeRef<'a>,
) -> P::ListEntry;

pub type CallbackPhaseOne<P> =
Expand Down Expand Up @@ -512,7 +512,7 @@ fn lookup_list_entry<P>(
phase: CommitPhase,
operation: CallbackOp,
callbacks: &Callbacks<P>,
dnode: &DataNodeRef<'_, 'static>,
dnode: &DataNodeRef<'_>,
) -> P::ListEntry
where
P: Provider,
Expand Down
6 changes: 2 additions & 4 deletions holo-northbound/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub trait Provider: ProviderBase {

fn relay_rpc(
&self,
_rpc: DataNodeRef<'_, '_>,
_rpc: DataNodeRef<'_>,
) -> Result<Option<Vec<NbDaemonSender>>, String> {
Ok(None)
}
Expand Down Expand Up @@ -194,9 +194,7 @@ async fn process_rpc_relayed(
Ok(response)
}

fn find_rpc<'a>(
data: &'a DataTree<'static>,
) -> Result<DataNodeRef<'a, 'static>, Error> {
fn find_rpc<'a>(data: &'a DataTree<'static>) -> Result<DataNodeRef<'a>, Error> {
data.traverse()
.find(|dnode| {
matches!(
Expand Down
12 changes: 6 additions & 6 deletions holo-northbound/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ where
fn iterate_node<'a, P>(
provider: &'a P,
cbs: &Callbacks<P>,
dnode: &mut DataNodeRef<'_, '_>,
dnode: &mut DataNodeRef<'_>,
snode: &SchemaNode<'_>,
list_entry: &P::ListEntry<'a>,
relay_list: &mut Vec<RelayedRequest>,
Expand Down Expand Up @@ -248,7 +248,7 @@ where
fn iterate_list<'a, P>(
provider: &'a P,
cbs: &Callbacks<P>,
dnode: &mut DataNodeRef<'_, '_>,
dnode: &mut DataNodeRef<'_>,
snode: &SchemaNode<'_>,
parent_list_entry: &P::ListEntry<'a>,
relay_list: &mut Vec<RelayedRequest>,
Expand Down Expand Up @@ -277,7 +277,7 @@ where
fn iterate_list_entry<'a, P>(
provider: &'a P,
cbs: &Callbacks<P>,
dnode: &mut DataNodeRef<'_, '_>,
dnode: &mut DataNodeRef<'_>,
snode: &SchemaNode<'_>,
list_entry: P::ListEntry<'a>,
relay_list: &mut Vec<RelayedRequest>,
Expand Down Expand Up @@ -335,7 +335,7 @@ where
fn iterate_container<'a, P>(
provider: &'a P,
cbs: &Callbacks<P>,
dnode: &mut DataNodeRef<'_, '_>,
dnode: &mut DataNodeRef<'_>,
snode: &SchemaNode<'_>,
list_entry: &P::ListEntry<'a>,
relay_list: &mut Vec<RelayedRequest>,
Expand Down Expand Up @@ -380,7 +380,7 @@ where
fn iterate_children<'a, P>(
provider: &'a P,
cbs: &Callbacks<P>,
dnode: &mut DataNodeRef<'_, '_>,
dnode: &mut DataNodeRef<'_>,
snode: &SchemaNode<'_>,
list_entry: &P::ListEntry<'a>,
relay_list: &mut Vec<RelayedRequest>,
Expand Down Expand Up @@ -425,7 +425,7 @@ where
fn lookup_list_entry<'a, P>(
provider: &'a P,
cbs: &Callbacks<P>,
dnode: &DataNodeRef<'_, '_>,
dnode: &DataNodeRef<'_>,
) -> P::ListEntry<'a>
where
P: Provider,
Expand Down
4 changes: 2 additions & 2 deletions holo-routing/src/northbound/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Provider for Master {

fn relay_rpc(
&self,
rpc: DataNodeRef<'_, '_>,
rpc: DataNodeRef<'_>,
) -> Result<Option<Vec<NbDaemonSender>>, String> {
let (protocol, name) = find_instance(rpc)?;

Expand Down Expand Up @@ -68,7 +68,7 @@ impl Provider for Master {
// easy way to identify the protocol type and name. YANG actions would greatly
// simplify this.
fn find_instance(
rpc: DataNodeRef<'_, '_>,
rpc: DataNodeRef<'_>,
) -> Result<(Protocol, Option<String>), String> {
let (protocol, name) = match rpc.schema().module().name() {
"ietf-bgp" => {
Expand Down
4 changes: 2 additions & 2 deletions holo-utils/src/yang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl SchemaNodeExt for SchemaNode<'_> {

// ===== impl DataNodeRef =====

impl DataNodeRefExt for DataNodeRef<'_, '_> {
impl DataNodeRefExt for DataNodeRef<'_> {
fn exists(&self, path: &str) -> bool {
self.find_xpath(path).unwrap().next().is_some()
}
Expand Down Expand Up @@ -356,7 +356,7 @@ impl DataNodeRefExt for DataNodeRef<'_, '_> {

// ===== helper functions =====

fn panic_wrong_dnode_type(dnode: &DataNodeRef<'_, '_>, expected: &str) -> ! {
fn panic_wrong_dnode_type(dnode: &DataNodeRef<'_>, expected: &str) -> ! {
panic!(
"wrong data node type (was expecting {}): {}",
expected,
Expand Down
2 changes: 1 addition & 1 deletion holo-yang/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ pub trait TryFromYang: Sized {
pub trait YangObject {
// Initialize a given YANG data node with attributes from the current
// object.
fn into_data_node(self: Box<Self>, dnode: &mut DataNodeRef<'_, '_>);
fn into_data_node(self: Box<Self>, dnode: &mut DataNodeRef<'_>);

// Return the keys of the list, or an empty string for containers or keyless
// lists.
Expand Down

0 comments on commit 37114c3

Please sign in to comment.