Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GCWing/BitFun
/ char_to_byte
Function
char_to_byte
src/apps/cli/src/ui/model_config_form.rs:1120–1125 ·
view source on GitHub ↗
(s: &str, char_idx: usize)
Source
from the content-addressed store, hash-verified
1118
// ── Helpers ──
1119
1120
fn char_to_byte(s: &str, char_idx: usize) -> usize {
1121
s.char_indices()
1122
.nth(char_idx)
1123
.map(|(i, _)| i)
1124
.unwrap_or(s.len())
1125
}
Callers
2
handle_key_event
Method · 0.70
render_field_input
Method · 0.70
Calls
1
len
Method · 0.45
Tested by
no test coverage detected