/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2026 metamuffin <metamuffin.org>
*/

use super::A;
use jellycommon::NodeID;
use rocket::request::FromParam;
use std::str::FromStr;

impl<'a> FromParam<'a> for A<NodeID> {
    type Error = ();
    fn from_param(param: &'a str) -> Result<Self, Self::Error> {
        NodeID::from_str(param).map_err(|_| ()).map(A)
    }
}
