Home
last modified time | relevance | path

Searched refs:unwrap (Results 1 – 25 of 67) sorted by relevance

123

/linux/scripts/
H A Drustdoc_test_gen.rs58 let potential_components: Vec<&str> = file.strip_suffix("_rs").unwrap().split('_').collect(); in find_real_path()
100 [valid_path] => valid_path.to_str().unwrap(), in find_real_path()
106 writeln!(&mut candidates, " {path:?}").unwrap(); in find_real_path()
117 let srctree = std::env::var("srctree").unwrap(); in main()
121 .unwrap() in main()
122 .map(|entry| entry.unwrap().path()) in main()
137 let name = path.file_name().unwrap().to_str().unwrap().to_string(); in main()
140 let (file, line) = name.rsplit_once('_').unwrap().0.rsplit_once('_').unwrap(); in main()
[all...]
H A Drustdoc_test_builder.rs23 stdin.read_to_string(&mut body).unwrap(); in main()
62 // For tests that get generated with `Result`, like above, `rustdoc` generates an `unwrap()` on in main()
68 &format!("}} {rustdoc_function_name}().unwrap() }}"), in main()
73 let name = rustdoc_function_name.split_once("_rust_kernel_").unwrap().1; in main()
84 std::fs::write(path, body.as_bytes()).unwrap();
H A Dgenerate_rust_target.rs144 if handle.read_line(&mut line).unwrap() == 0 { in from_stdin()
175 .unwrap() in rustc_version_atleast()
177 .unwrap(); in rustc_version_atleast()
/linux/rust/zerocopy/src/
H A Dref.rs1271 // `unwrap` will not panic. in test_eq()
1342 // so this `unwrap` will not panic. in bench_deref_sized()
1472 let r = Ref::<&mut [u8], u8>::from_bytes(&mut buf).unwrap();
1482 let r = Ref::<_, u8>::from_bytes(&buf[..]).unwrap();
1488 let r = Ref::<_, [u8]>::from_bytes(&buf[..]).unwrap();
1521 let whole = Ref::<_, Frame>::from_bytes_with_elems(&bytes.t[..16], 1).unwrap();
1529 let (prefix, rest) = Ref::<_, Frame>::from_prefix_with_elems(&bytes.t[..], 1).unwrap();
1533 let (before, suffix) = Ref::<_, Frame>::from_suffix_with_elems(&bytes.t[..24], 1).unwrap();
1538 let empty = Ref::<_, OddHeader>::from_bytes_with_elems(&bytes.t[..8], 0).unwrap();
1544 let inferred = Ref::<_, Frame>::from_bytes(&bytes.t[..16]).unwrap();
[all...]
H A Dsplit_at.rs61 /// let packet = Packet::mut_from_bytes(&mut bytes[..]).unwrap();
63 /// packet.split_at_mut(1).unwrap().via_into_bytes();
162 /// let packet = Packet::ref_from_bytes(bytes).unwrap(); in split_at()
168 /// let split = packet.split_at(packet.length as usize).unwrap(); in split_at()
247 /// let packet = Packet::<[u8]>::mut_from_bytes(bytes).unwrap(); in split_at_mut()
254 /// let split = packet.split_at_mut(packet.length as usize).unwrap();
393 /// let packet = Packet::ref_from_bytes(bytes).unwrap();
399 /// let split = packet.split_at(packet.length as usize).unwrap();
456 /// let packet = Packet::<[u8]>::ref_from_bytes(bytes).unwrap();
462 /// let split = packet.split_at(packet.length as usize).unwrap();
[all...]
H A Dmacros.rs308 /// let src = Src::ref_from_bytes(&[0, 1, 2, 3, 4, 5, 6, 7]).unwrap();
528 /// let src = Src::mut_from_bytes(&mut bytes[..]).unwrap();
695 /// let dst: &[u8] = try_transmute_ref!(src).unwrap();
738 /// let src = Src::ref_from_bytes(&[0, 1, 0, 1, 0, 1, 0, 1]).unwrap();
739 /// let dst: &Dst = try_transmute_ref!(src).unwrap();
841 /// let dst: &mut [u8] = try_transmute_mut!(src).unwrap();
889 /// let src = Src::mut_from_bytes(&mut bytes).unwrap();
895 /// let dst: &Dst = try_transmute_mut!(src).unwrap();
1388 SliceDst::<U16, [u8; 2]>::ref_from_bytes(&[0, 1, 2, 3, 4, 5][..]).unwrap(); in test_transmute_ref()
1390 SliceDst::<U16, U16>::ref_from_bytes(&[0, 1, 2, 3, 4, 5][..]).unwrap(); in test_transmute_ref()
[all...]
H A Dlib.rs307 // messages are less important. You also often unwrap a lot, which would
1996 /// let packet = Packet::try_ref_from_bytes(bytes).unwrap();
2118 /// let (packet, suffix) = Packet::try_ref_from_prefix(bytes).unwrap();
2228 /// let (prefix, packet) = Packet::try_ref_from_suffix(bytes).unwrap();
2338 /// let packet = Packet::try_mut_from_bytes(bytes).unwrap();
2445 /// let (packet, suffix) = Packet::try_mut_from_prefix(bytes).unwrap();
2545 /// let (prefix, packet) = Packet::try_mut_from_suffix(bytes).unwrap();
2619 /// let packet = Packet::try_ref_from_bytes_with_elems(bytes, 3).unwrap();
2647 /// let zsty = ZSTy::try_ref_from_bytes_with_elems(src, 42).unwrap(); in try_ref_from_prefix_with_elems()
2739 /// let (packet, suffix) = Packet::try_ref_from_prefix_with_elems(bytes, 3).unwrap();
[all...]
H A Dlayout.rs2304 let trailing_end = layout.offset.checked_add(trailing_size).unwrap();
2305 let expected = object_size.checked_sub(trailing_end).unwrap();
2461 let nz = |n| NonZeroUsize::new(n).unwrap();
2579 let nz = |n| NonZeroUsize::new(n).unwrap();
2690 let align = NonZeroUsize::new(1usize << shift).unwrap();
2719 let align = NonZeroUsize::new(align).unwrap();
2755 let alignment = NonZeroUsize::new(1usize << exponent).unwrap();
2768 assert!(checked_size(layout, max_bytes).unwrap() <= available);
2842 let alignment = NonZeroUsize::new(1usize << exponent).unwrap();
2919 align: NonZeroUsize::new(align).unwrap(),
[all...]
/linux/rust/kernel/alloc/
H A Dkvec.rs1549 let mut vec1: KVec<usize> = KVec::with_capacity(c.len(), GFP_KERNEL).unwrap(); in test_kvvec_shrink_to()
1550 let mut vec2: KVec<usize> = KVec::with_capacity(c.len(), GFP_KERNEL).unwrap(); in test_kvvec_shrink_to()
1553 vec1.push_within_capacity(i).unwrap(); in test_kvvec_shrink_to()
1555 vec2.push_within_capacity(i).unwrap();
1577 let mut func = KVec::with_capacity(10, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_no_op()
1583 func.push_within_capacity(false).unwrap(); in test_kvvec_shrink_to_no_op()
1592 let mut v = KVVec::<u8>::with_capacity(PAGE_SIZE * 4, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_respects_min_capacity()
1595 v.push(1, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_respects_min_capacity()
1596 v.push(2, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_respects_min_capacity()
1597 v.push(3, GFP_KERNEL).unwrap(); in test_kvvec_shrink_to_respects_min_capacity()
[all...]
/linux/rust/macros/
H A Dvtable.rs
H A Dpin_data.rs
H A Dpinned_drop.rs
/linux/drivers/android/binder/range_alloc/
H A Dtree.rs50 let free_node = alloc.free_tree.pop().unwrap(); in from_array()
53 let tree_node = alloc.tree.pop().unwrap(); in from_array()
64 let free_res = alloc.free_tree.pop().unwrap(); in from_array()
65 let tree_node = alloc.tree.pop().unwrap(); in from_array()
74 let free_node = alloc.free_tree.pop().unwrap(); in from_array()
77 let tree_node = alloc.tree.pop().unwrap(); in from_array()
89 let first_value = tree_iter.next().unwrap(); in is_empty()
/linux/net/sunrpc/auth_gss/
H A Dgss_krb5_mech.c314 * @len: size of ciphertext to unwrap in gss_krb5_import_ctx_v2()
315 * @buf: ciphertext to unwrap in gss_krb5_import_ctx_v2()
/linux/rust/kernel/
H A Dtypes.rs242 self.0.take().unwrap().0
257 // The type invariants guarantee that `unwrap` will succeed. in deref_mut()
258 &self.0.as_ref().unwrap().0
264 // The type invariants guarantee that `unwrap` will succeed. in drop()
265 &mut self.0.as_mut().unwrap().0 in drop()
/linux/fs/ecryptfs/
H A DKconfig18 bool "Enable notifications for userspace key wrap/unwrap"
22 for userspace to wrap/unwrap file encryption keys by other
/linux/rust/syn/
H A Dattr.rs250 path.segments.first().unwrap().ident.span(), in parse_args_with()
251 path.segments.last().unwrap().ident.span(), in parse_args_with()
538 path.segments.first().unwrap().ident.span(), in require_list()
539 path.segments.last().unwrap().ident.span(), in require_list()
556 path.segments.first().unwrap().ident.span(), in require_name_value()
557 path.segments.last().unwrap().ident.span(), in require_name_value()
H A Dclassify.rs108 match &path.segments.last().unwrap().arguments { in trailing_unparameterized_path()
121 match bounds.last().unwrap() { in trailing_unparameterized_path()
282 match &path.segments.last().unwrap().arguments { in expr_trailing_brace()
294 match bounds.last().unwrap() { in expr_trailing_brace()
H A Dlit.rs422 let mut token: Literal = repr.parse().unwrap(); in new()
516 let mut token: Literal = repr.parse().unwrap(); in new()
909 let mut token: Literal = repr.parse().unwrap(); in parse_negative_lit()
924 let mut token: Literal = repr.parse().unwrap(); in parse_negative_lit()
1302 char::from_u32(u32::from(byte)).unwrap() in parse_lit_str_cooked()
1358 let close = s.rfind('"').unwrap(); in parse_lit_str_raw()
1518 (CString::new(out).unwrap(), suffix) in parse_lit_c_str_cooked()
1524 (CString::new(String::from(value)).unwrap(), suffix) in parse_lit_c_str_raw()
1583 char::from_u32(u32::from(byte)).unwrap() in parse_lit_char()
1853 let mut digits = String::from_utf8(bytes).unwrap(); in parse_lit_float()
H A Dverbatim.rs15 let (tt, next) = cursor.token_tree().unwrap(); in between()
/linux/rust/zerocopy/src/pointer/
H A Dinner.rs635 let dst = <[u8]>::ref_from_bytes(&arr[..]).unwrap();
657 let dst = SliceDst::<OFFSET>::ref_from_bytes(&arr[..]).unwrap(); in test_split_at()
709 let dst = SliceDst::<OFFSET>::ref_from_bytes(&arr[..]).unwrap(); in test_trailing_slice()
725 isize::try_from(OFFSET).unwrap(), in test_trailing_slice()
/linux/rust/pin-init/examples/
H A Dstatic_init.rs87 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main()
H A Dbig_struct_in_place.rs40 .unwrap(); in main()
/linux/rust/pin-init/src/
H A D__internal.rs199 let value = value.unwrap(); in init()
206 let value = value.unwrap(); in init()
/linux/drivers/usb/gadget/function/
H A Du_ether.c75 int (*unwrap)(struct gether *, member
239 if (dev->unwrap) { in rx_complete()
244 status = dev->unwrap(dev->port_usb, in rx_complete()
1177 dev->unwrap = link->unwrap; in gether_connect()
1272 dev->unwrap = NULL;

123